Skip to content

Commit

Permalink
Auto-correct RuboCop offenses for RSpec/ItBehavesLike - spec/controllers
Browse files Browse the repository at this point in the history
Cassettes had to be renamed to follow the changes.
  • Loading branch information
Dany Marcoux committed Jun 9, 2020
1 parent 0756da6 commit ac8636f
Show file tree
Hide file tree
Showing 22 changed files with 10 additions and 13 deletions.
3 changes: 0 additions & 3 deletions src/api/.rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,6 @@ RSpec/InstanceVariable:
# SupportedStyles: it_behaves_like, it_should_behave_like
RSpec/ItBehavesLike:
Exclude:
- 'spec/controllers/person_controller_spec.rb'
- 'spec/controllers/webui/package_controller_spec.rb'
- 'spec/controllers/webui/project_controller_spec.rb'
- 'spec/helpers/webui/package_helper_spec.rb'
- 'spec/models/bs_request_action_spec.rb'
- 'spec/models/bs_request_spec.rb'
Expand Down
4 changes: 2 additions & 2 deletions src/api/spec/controllers/person_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@
login admin_user
end

it_should_behave_like 'not allowed to change user details'
it_behaves_like 'not allowed to change user details'
end

context 'as a user' do
before do
login user
end

it_should_behave_like 'not allowed to change user details'
it_behaves_like 'not allowed to change user details'
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions src/api/spec/controllers/webui/package_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def do_request(params)
get :live_build_log, params: params
end

it_should_behave_like 'build log'
it_behaves_like 'build log'

context 'with a nonexistant repository' do
before do
Expand Down Expand Up @@ -789,7 +789,7 @@ def do_request(params)
get :update_build_log, params: params, xhr: true
end

it_should_behave_like 'build log'
it_behaves_like 'build log'

context 'with a nonexistant repository' do
before do
Expand Down
12 changes: 6 additions & 6 deletions src/api/spec/controllers/webui/project_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@

it { expect(assigns(:project).name).to eq("#{user.home_project_name}:my_project") }

it_should_behave_like 'a valid project saved'
it_behaves_like 'a valid project saved'
end

context 'with a param called maintenance_project' do
Expand All @@ -424,7 +424,7 @@

it { expect(assigns(:project).kind).to eq('maintenance') }

it_should_behave_like 'a valid project saved'
it_behaves_like 'a valid project saved'
end

context 'with a param that disables a flag' do
Expand All @@ -436,12 +436,12 @@
it { expect(assigns(:project).flags.first.flag).to eq(flag_name) }
it { expect(assigns(:project).flags.find_by(flag: flag_name).status).to eq('disable') }

it_should_behave_like 'a valid project saved'
it_behaves_like 'a valid project saved'
end

it_should_behave_like 'a param that creates a disabled flag', :access_protection, 'access'
it_should_behave_like 'a param that creates a disabled flag', :source_protection, 'sourceaccess'
it_should_behave_like 'a param that creates a disabled flag', :disable_publishing, 'publish'
it_behaves_like 'a param that creates a disabled flag', :access_protection, 'access'
it_behaves_like 'a param that creates a disabled flag', :source_protection, 'sourceaccess'
it_behaves_like 'a param that creates a disabled flag', :disable_publishing, 'publish'
end

context 'with an invalid project data' do
Expand Down

0 comments on commit ac8636f

Please sign in to comment.