forked from railsbridge/bridge_troll
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added capybara, guard and create part of the user flow integration test
- Loading branch information
Showing
7 changed files
with
115 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ | |
# Ignore all logfiles and tempfiles. | ||
/log/*.log | ||
/tmp | ||
|
||
# Ignore Rubymine created folder | ||
.idea |
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,19 @@ | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
guard 'rspec', :version => 2 do | ||
watch(%r{^spec/.+_spec\.rb$}) | ||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | ||
watch('spec/spec_helper.rb') { "spec" } | ||
|
||
# Rails example | ||
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | ||
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } | ||
watch(%r{^spec/support/(.+)\.rb$}) { "spec" } | ||
watch('config/routes.rb') { "spec/routing" } | ||
watch('app/controllers/application_controller.rb') { "spec/controllers" } | ||
# Capybara request specs | ||
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" } | ||
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,4 @@ | ||
Factory.define :user do |f| | ||
f.sequence(:email) { |n| "example0#{n}@example.com"} | ||
f.password "test123" | ||
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,61 @@ | ||
require 'spec_helper' | ||
|
||
describe "existing user", :js => true do | ||
|
||
before(:each) do | ||
@user = Factory(:user) | ||
@user.confirm! | ||
|
||
@event = Factory(:event) | ||
|
||
end | ||
|
||
it "should signin and edit his/her settings" do | ||
visit new_user_session_path | ||
|
||
fill_in "Email", :with => @user.email | ||
fill_in "Password", :with => @user.password | ||
click_button "Sign in" | ||
|
||
page.should have_content("Signed in successfully") | ||
|
||
page.should have_content("Become Volunteer") | ||
|
||
click_link "Become A Volunteer" | ||
|
||
page.should have_content("specify your skills") | ||
|
||
check("Coordinating") | ||
check("Teaching") | ||
check("TAing") | ||
check("Mentoring") | ||
check("Childcaring") | ||
check("Writing") | ||
page.should have_content("Evangelizing") | ||
page.should have_content("Other") | ||
|
||
click_button "Submit" | ||
|
||
page.should have_content("Thanks for submitting your skills") | ||
|
||
@user.skills.should == ["Coordinating", "Teaching", "TAing", "Mentoring", "Hacking", "Designing", "Childcaring", "Writing"] | ||
|
||
page.should have_content("Update your skills") | ||
|
||
click_link "Update your skills" | ||
|
||
page.should have_content("specify your skills") | ||
|
||
uncheck("Hacking") | ||
uncheck("Designing") | ||
|
||
click_button "Submit" | ||
|
||
page.should have_content("Thanks for submitting your skills") | ||
|
||
@user.skills.should == ["Coordinating", "Teaching", "TAing", "Mentoring", "Childcaring", "Writing"] | ||
|
||
|
||
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