File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Given /^a logged in user$/ do
2+ @user = User . create! ( username : "test_user" ,
3+ email : "test_user@example.com" ,
4+ password : "foobar" ,
5+ password_confirmation : "foobar" )
6+ visit ( '/login' )
7+ fill_in ( "Username" , :with => @user . username )
8+ fill_in ( "Password" , :with => @user . password )
9+ click_button ( "Sign in" )
10+ end
11+
12+ When /^I go to look at my profile page$/ do
13+ visit user_path ( @user )
14+ end
15+
16+ Then /^it should have the right information$/ do
17+ page . should have_selector ( 'title' , :content => "#{ @user . username } 's page" )
18+ page . should have_content ( "About #{ @user . username } " )
19+ end
Original file line number Diff line number Diff line change 3131
3232# Remove/comment out the lines below if your app doesn't have a database.
3333# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
34- begin
35- DatabaseCleaner . strategy = :transaction
36- rescue NameError
37- raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
34+ DatabaseCleaner . orm = "mongo_mapper"
35+ DatabaseCleaner [ :mongo_mapper ] . strategy = :truncation
36+
37+ Before do
38+ DatabaseCleaner [ :mongo_mapper ] . clean
3839end
3940
4041# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
Original file line number Diff line number Diff line change 1+ Feature : Manage account
2+
3+ As a user of this site, I can view and update my profile
4+
5+ Background : The user is logged in
6+ Given a logged in user
7+
8+ Scenario : View my profile
9+ When I go to look at my profile page
10+ Then it should have the right information
11+
12+ Scenario : Edit my profile
13+ When I go to change my settings
14+ And fill in the following
15+ | About | New users love editing their page |
16+ | Current password | foobar |
17+ And submit the form
18+ Then I should be notified that my profile was updated
19+ When I look at my page
20+ Then I should see my changes reflected
You can’t perform that action at this time.
0 commit comments