This repository has been archived by the owner on Jul 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brian Douglas
committed
Sep 18, 2014
1 parent
59234b3
commit 0681701
Showing
6 changed files
with
36 additions
and
22 deletions.
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
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,9 +1,22 @@ | ||
FactoryGirl.define do | ||
factory :user do | ||
email 'me@me.com' | ||
sequence(:email) { |n|"me#{n}@me.com" } | ||
name 'brian' | ||
username 'brianllamar' | ||
password 'monkeyturtles' | ||
password_confirmation 'monkeyturtles' | ||
sequence(:username) { |n| "brianllamar#{n}"} | ||
password 'top_secret' | ||
password_confirmation 'top_secret' | ||
end | ||
|
||
factory :fake_user do | ||
email Faker::Internet.email | ||
name Faker::Name.name | ||
username Faker::Internet.user_name | ||
password 'top_secret' | ||
password_confirmation 'top_secret' | ||
|
||
factory :confirmed_user, :parent => :user do | ||
after(:create) { |user| user.confirm! } | ||
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 |
---|---|---|
@@ -1,19 +1,15 @@ | ||
require 'spec_helper' | ||
|
||
user = FactoryGirl.build(:user) | ||
feature "logging in" do | ||
user = FactoryGirl.build(:confirmed_user) | ||
|
||
feature "login" do | ||
it "should work and view as a user" do | ||
visit root_path | ||
click_on 'Sign In' | ||
fill_in 'Email', with: user.email | ||
fill_in 'Password', with: user.password | ||
click_button 'Sign In' | ||
# save_and_open_page | ||
|
||
# assert page.has_content?("Discover Churches") | ||
assert_redirected_to root_path | ||
click_on 'Sign In' | ||
fill_in 'Email', with: user.email | ||
fill_in 'Password', with: user.password | ||
click_on 'Sign in' | ||
expect(page).to have_content | ||
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
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