File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323
2424 describe 'Following actions' do
2525 before { sign_in bob }
26- it ( '#follow' ) do
26+ it ( 'Try to follow himself' ) do
27+ post :follow , user_id : bob , :user => { :followee => bob . id }
28+ expect ( flash [ :notice ] ) . to eq ( "You can't follow yourself silly!" )
29+ end
30+
31+ it ( '#follow just once' ) do
2732 post :follow , user_id : bob , :user => { :followee => mozart . id }
2833 expect ( flash [ :notice ] ) . to eq ( "You're following #{ mozart . username } now" )
34+ post :follow , user_id : bob , :user => { :followee => mozart . id }
35+ expect ( flash [ :notice ] ) . to eq ( "You're already following #{ mozart . username } " )
2936 end
37+
3038 it ( '#following?' ) do
3139 get :following , user_id : bob
3240 response . should be_success
3341 end
42+
3443 it ( '#followers' ) do
3544 get :followers , user_id : bob
3645 response . should be_success
3746 end
47+
48+ it ( '#unfollow' ) do
49+ post :unfollow , user_id : bob , :user => { :followee => mozart . id }
50+ expect ( flash [ :notice ] ) . to eq ( "You're no longer following #{ mozart . username } " )
51+ end
3852 end
3953end
You can’t perform that action at this time.
0 commit comments