Enables RSpec/ExampleWording and fixes all issues

Both avoiding 'should' and repiting 'it' on the tests description
improves reading them and also makes all descriptions consistent.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
This commit is contained in:
Bertocq
2018-01-07 00:57:50 +01:00
parent 971f2e308a
commit ed16a78f42
73 changed files with 482 additions and 479 deletions

View File

@@ -6,7 +6,7 @@ describe Admin::Api::StatsController do
let(:user) { create(:administrator).user }
context 'events or visits not present' do
it 'should respond with bad_request' do
it 'responds with bad_request' do
sign_in user
get :show
@@ -29,7 +29,7 @@ describe Admin::Api::StatsController do
create :ahoy_event, name: 'bar', time: time_3
end
it 'should return single events formated for working with c3.js' do
it 'returns single events formated for working with c3.js' do
sign_in user
get :show, events: 'foo'
@@ -39,7 +39,7 @@ describe Admin::Api::StatsController do
expect(data).to eq "x" => ["2015-01-01", "2015-01-02"], "Foo" => [2, 1]
end
it 'should return combined comma separated events formated for working with c3.js' do
it 'returns combined comma separated events formated for working with c3.js' do
sign_in user
get :show, events: 'foo,bar'
@@ -51,7 +51,7 @@ describe Admin::Api::StatsController do
end
context 'visits present' do
it 'should return visits formated for working with c3.js' do
it 'returns visits formated for working with c3.js' do
time_1 = DateTime.parse("2015-01-01").in_time_zone
time_2 = DateTime.parse("2015-01-02").in_time_zone
@@ -70,7 +70,7 @@ describe Admin::Api::StatsController do
end
context 'visits and events present' do
it 'should return combined events and visits formated for working with c3.js' do
it 'returns combined events and visits formated for working with c3.js' do
time_1 = DateTime.parse("2015-01-01").in_time_zone
time_2 = DateTime.parse("2015-01-02").in_time_zone
@@ -93,7 +93,7 @@ describe Admin::Api::StatsController do
end
context 'budget investments present' do
it 'should return budget investments formated for working with c3.js' do
it 'returns budget investments formated for working with c3.js' do
time_1 = DateTime.parse("2017-04-01").in_time_zone
time_2 = DateTime.parse("2017-04-02").in_time_zone