File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,17 +23,20 @@ def unfollow
2323 end
2424
2525 def following
26- @user = User . first ( :id => params [ :user_id ] )
26+ puts "called"
27+ @user = User . first ( :username => params [ :user_id ] )
28+ puts "@user: #{ @user } "
2729 end
2830
2931 def followers
30- @user = User . first ( :id => params [ :user_id ] )
32+ @user = User . first ( :username => params [ :user_id ] )
3133 end
3234
3335 #################
3436
3537 def resource
3638 @user ||= end_of_association_chain . find_by_username ( params [ :id ] )
3739 end
38-
40+
3941end
42+
Original file line number Diff line number Diff line change @@ -29,6 +29,24 @@ def login_user
2929 click_button "Update"
3030end
3131
32+ When /^I click on the number of followers on my profile$/ do
33+ step 'I go to look at my profile page'
34+ first ( '.user-followers' ) . click
35+ end
36+
37+ When /^I click on the number of people I am following on my profile$/ do
38+ step 'I go to look at my profile page'
39+ first ( '.user-following' ) . click
40+ end
41+
42+ Then /^I should see a list of the people I'm following$/ do
43+ page . should have_content "#{ @user . username } is following"
44+ end
45+
46+ Then /^I should see a list of my followers$/ do
47+ page . should have_content "#{ @user . username } 's followers"
48+ end
49+
3250Then /^I should be notified that my profile was updated$/ do
3351 page . should have_content ( "updated your account" )
3452end
@@ -37,3 +55,4 @@ def login_user
3755 visit ( "/users/#{ @user . username } " )
3856 page . should have_content ( "Test user likes to edit his profile" )
3957end
58+
Original file line number Diff line number Diff line change 11Feature : Manage account
22
3- As a user of this site, I can view and update my profile
3+ As a user of this site, I can view and update my profile, see my followers
44
55 Background : The user is logged in
66 Given a logged in user
@@ -12,4 +12,13 @@ Feature: Manage account
1212 Scenario : Edit my profile
1313 When I edit my profile
1414 Then I should be notified that my profile was updated
15- And I should see my changes reflected on my profile page
15+ And I should see my changes reflected on my profile page
16+
17+ Scenario : See my followers
18+ When I click on the number of followers on my profile
19+ Then I should see a list of my followers
20+
21+ Scenario : See who is following me
22+ When I click on the number of people I am following on my profile
23+ Then I should see a list of the people I'm following
24+
You can’t perform that action at this time.
0 commit comments