Skip to content

Commit 2f37c11

Browse files
author
Sanjiv Jha
committed
Removed all instance of should matcher & added expect instead of should
1 parent 3dfbf89 commit 2f37c11

3 files changed

Lines changed: 15 additions & 12 deletions

File tree

spec/controllers/projects_controller_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
describe 'POST #search' do
5454
it 'returns 200 status code' do
5555
post :search
56-
response.should be_success
56+
expect(response).to be_success
5757
end
5858
end
5959

@@ -75,15 +75,15 @@
7575
when :get ; get action , :id => a_project.id
7676
when :patch ; patch action , :id => a_project.id
7777
end
78-
response.should be_redirect
78+
expect(response).to be_redirect
7979
end
8080

8181
it 'via project name returns 200 status code' do
8282
case verb
8383
when :get ; get action , :service => 'github' , :repo => a_project.full_name
8484
when :patch ; patch action , :service => 'github' , :repo => a_project.full_name
8585
end
86-
response.should be_success
86+
expect(response).to be_success
8787
end
8888
end
8989

@@ -93,15 +93,15 @@
9393
when :get ; get action , :id => 999999
9494
when :patch ; patch action , :id => 999999
9595
end
96-
response.should be_redirect
96+
expect(response).to be_redirect
9797
end
9898

9999
it 'via project name returns 200 status code' do
100100
case verb
101101
when :get ; get action , :service => 'github' , :repo => 'no-such/project' ;
102102
when :patch ; patch action , :service => 'github' , :repo => 'no-such/project' ;
103103
end
104-
response.should be_redirect
104+
expect(response).to be_redirect
105105
end
106106
end
107107
end
@@ -125,7 +125,7 @@
125125
# include_context 'accessing_project' , :get , :edit
126126

127127
get :edit , :service => 'github' , :repo => 'test/test'
128-
response.should be_redirect
128+
expect(response).to be_redirect
129129
end
130130
end
131131

@@ -135,7 +135,7 @@
135135

136136
it 'returns 302 status code' do
137137
get :decide_tip_amounts , :service => 'github' , :repo => 'test/test'
138-
response.should be_redirect
138+
expect(response).to be_redirect
139139
end
140140
end
141141

@@ -145,7 +145,7 @@
145145

146146
it 'returns 302 status code' do
147147
patch :decide_tip_amounts , :service => 'github' , :repo => 'test/test'
148-
response.should be_redirect
148+
expect(response).to be_redirect
149149
end
150150
end
151151

spec/models/user_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@
2929
context 'when address is blank' do
3030
it 'should be valid' do
3131
user.bitcoin_address = ''
32-
user.should be_valid
32+
expect(user).to be_valid
3333
end
3434
end
3535

3636
context 'when address is valid' do
3737
it 'should be valid' do
3838
user.bitcoin_address = '1M4bS4gPyA6Kb8w7aXsgth9oUZWcRk73tQ'
39-
user.should be_valid
39+
expect(user).to be_valid
4040
end
4141
end
4242

4343
context 'when address is not valid' do
4444
it 'should not be valid' do
4545
user.bitcoin_address = '1M4bS4gPyA6Kb8w7aXsgth9oUZXXXXXXXX'
46-
user.should_not be_valid
46+
expect(user).not_to be_valid
4747
end
4848
end
4949

5050
end
51-
end
51+
end

spec/spec_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
2+
require "minitest/autorun"
13
require 'simplecov'
4+
25
SimpleCov.start 'rails'
36

47
# This file is copied to spec/ when you run 'rails generate rspec:install'

0 commit comments

Comments
 (0)