|
4 | 4 | let(:bob){Fabricate(:user)} |
5 | 5 | let(:mozart){Fabricate(:user)} |
6 | 6 |
|
7 | | - describe('#index') do |
| 7 | + describe '#index' do |
8 | 8 | context "When user is no moderator" do |
9 | 9 | it "try to get index" do |
10 | 10 | get :index |
11 | | - response.should redirect_to(root_path) |
| 11 | + expect(response).to redirect_to(root_path) |
12 | 12 | end |
13 | 13 | end |
14 | 14 |
|
|
23 | 23 |
|
24 | 24 | describe 'Following actions' do |
25 | 25 | before { sign_in bob } |
26 | | - it('Try to follow himself') do |
| 26 | + it 'Try to follow himself' do |
27 | 27 | post :follow, user_id: bob, :user => {:followee => bob.id} |
28 | 28 | expect(flash[:notice]).to eq("You can't follow yourself silly!") |
29 | 29 | end |
30 | 30 |
|
31 | | - it('#follow just once') do |
| 31 | + it '#follow just once' do |
32 | 32 | post :follow, user_id: bob, :user => {:followee => mozart.id} |
33 | 33 | expect(flash[:notice]).to eq("You're following #{mozart.username} now") |
34 | 34 | post :follow, user_id: bob, :user => {:followee => mozart.id} |
35 | 35 | expect(flash[:notice]).to eq("You're already following #{mozart.username}") |
36 | 36 | end |
37 | 37 |
|
38 | | - it('#following?') do |
| 38 | + it '#following?' do |
39 | 39 | get :following, user_id: bob |
40 | 40 | response.should be_success |
41 | 41 | end |
42 | 42 |
|
43 | | - it ('#followers') do |
| 43 | + it '#followers' do |
44 | 44 | get :followers, user_id: bob |
45 | 45 | response.should be_success |
46 | 46 | end |
47 | 47 |
|
48 | | - it ('#unfollow') do |
| 48 | + it '#unfollow' do |
49 | 49 | post :unfollow, user_id: bob, :user => {:followee => mozart.id} |
50 | 50 | expect(flash[:notice]).to eq("You're no longer following #{mozart.username}") |
51 | 51 | end |
|
0 commit comments