-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing users #2
Open
ccrawford13
wants to merge
3
commits into
master
Choose a base branch
from
testing-users
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,6 @@ | |
/log/* | ||
!/log/.keep | ||
/tmp | ||
|
||
# Ignore application configuration | ||
/config/application.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
module ApplicationHelper | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SENDGRID_PASSWORD: | ||
SENDGRID_USERNAME: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SENDGRID_PASSWORD: zx0wd0ff | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't want this file appearing in your source control. You may have added it before you changed your |
||
SENDGRID_USERNAME: [email protected] | ||
SECRET_KEY_BASE: 314938c9e3d27bef9aeb1ad15e0276cac9beecac5afdb55e0f79b7c6f5693eb1f01b2c3dc3c78ea8d2828ae5869d49de1cde45900c7d1d1846c9b20e6432b3ff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
if Rails.env.development? | ||
ActionMailer::Base.delivery_method = :smtp | ||
ActionMailer::Base.smtp_settings = { | ||
address: 'smtp.sendgrid.net', | ||
port: '587', | ||
authentication: :plain, | ||
user_name: ENV['SENDGRID_USERNAME'], | ||
password: ENV['SENDGRID_PASSWORD'], | ||
domain: 'heroku.com', | ||
enable_starttls_auto: true | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
require 'rails_helper' | ||
|
||
describe "Edit user attributes" do | ||
|
||
describe "change user password" do | ||
before do | ||
@user = create(:user) | ||
|
||
#Sign in User | ||
visit new_user_session_path | ||
|
||
fill_in "Email", with: @user.email | ||
fill_in "Password", with: @user.password | ||
click_button "Log in" | ||
expect( current_path ).to eq(root_path) | ||
visit edit_user_registration_path | ||
end | ||
|
||
it "is not updated without current password" do | ||
|
||
fill_in "Password", with: 'newpassword' | ||
fill_in "Password confirmation", with: 'newpassword' | ||
fill_in "Current password", with: '' | ||
click_button "Update" | ||
expect( page ).to have_content("Current password can't be blank") | ||
end | ||
|
||
it "is not updated if 'password confirmation' does not mach password" do | ||
|
||
fill_in "Password", with: 'newpassword' | ||
fill_in "Password confirmation", with: 'password' | ||
fill_in "Current password", with: @user.password | ||
click_button "Update" | ||
expect( page ).to have_content("Password confirmation doesn't match Password") | ||
end | ||
|
||
it "is not updated if password is shorter than 8 characters" do | ||
|
||
fill_in "Password", with: 'word' | ||
fill_in "Password confirmation", with: 'word' | ||
fill_in "Current password", with: @user.password | ||
click_button "Update" | ||
expect( page ).to have_content("Password is too short") | ||
end | ||
|
||
it "updates password with all fields correctly entered" do | ||
fill_in "Password", with: 'newpassword' | ||
fill_in "Password confirmation", with: 'newpassword' | ||
fill_in "Current password", with: @user.password | ||
click_button "Update" | ||
expect( current_path ).to eq(root_path) #I'd like to test expect( flash[:notice] ).to eq "User was updated successfully" | ||
end | ||
|
||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
require 'rails_helper' | ||
|
||
describe 'User sign-in' do | ||
|
||
describe "successful sign-in" do | ||
before do | ||
@user = create(:user) | ||
end | ||
|
||
it "allows confirmed user to sign-in" do | ||
|
||
visit new_user_session_path | ||
|
||
fill_in "Email", with: @user.email | ||
fill_in "Password", with: @user.password | ||
click_button "Log in" | ||
expect( current_path ).to eq(root_path) | ||
end | ||
end | ||
|
||
describe "navigation changes to reflect #current_user" do | ||
before do | ||
@user = create(:user) | ||
end | ||
|
||
it "shows #user.name when signed in" do | ||
|
||
visit new_user_session_path | ||
|
||
fill_in "Email", with: @user.email | ||
fill_in "Password", with: @user.password | ||
click_button "Log in" | ||
expect( page ).to have_content(@user.name) | ||
end | ||
|
||
it "shows link to 'sign-in' when no user is signed in" do | ||
|
||
visit root_path | ||
|
||
within '.user-info' do | ||
expect( page ).to have_content("Sign In") | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this link will only display the user's name or email but not actually link to anything. Was that intentional?