Skip to content

Commit

Permalink
Merge pull request #5721 from openSUSE/depfu/update/srcapi/rubocop-rs…
Browse files Browse the repository at this point in the history
…pec-1.29.0

Update rubocop-rspec: 1.28.0 → 1.29.0 (minor)
  • Loading branch information
vpereira committed Aug 30, 2018
2 parents fa227ee + 568712d commit 4229725
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/api/Gemfile.lock
Expand Up @@ -353,7 +353,7 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
rubocop-rspec (1.28.0)
rubocop-rspec (1.29.0)
rubocop (>= 0.58.0)
ruby-ldap (0.9.20)
ruby-progressbar (1.10.0)
Expand Down
10 changes: 5 additions & 5 deletions src/api/spec/controllers/announcements_controller_spec.rb
Expand Up @@ -18,7 +18,7 @@
subject! { get :index, format: :xml }

it 'returns a success response' do
is_expected.to have_http_status(:success)
expect(subject).to have_http_status(:success)
end

it 'returns all announcements' do
Expand All @@ -38,7 +38,7 @@
subject! { get :index, format: :xml }

it 'returns a success response' do
is_expected.to have_http_status(:success)
expect(subject).to have_http_status(:success)
end

it 'returns an empty announcements xml' do
Expand Down Expand Up @@ -110,7 +110,7 @@
subject! { post :create, params: { id: announcement }, body: invalid_announcement_xml, format: :xml }

it 'returns a with an error' do
is_expected.to have_http_status(:bad_request)
expect(subject).to have_http_status(:bad_request)
assert_select 'status[code=invalid_announcement]' do
assert_select 'summary', "[\"Content can't be blank\"]"
end
Expand All @@ -137,15 +137,15 @@

it 'updates the requested announcement' do
expect(announcement.reload.title).to eq('Changed title')
is_expected.to have_http_status(:success)
expect(subject).to have_http_status(:success)
end
end

context 'with invalid params' do
subject! { put :update, params: { id: announcement }, body: invalid_announcement_xml, format: :xml }

it 'returns an error' do
is_expected.to have_http_status(:bad_request)
expect(subject).to have_http_status(:bad_request)
assert_select 'status[code=invalid_announcement]' do
assert_select 'summary', "[\"Title can't be blank\"]"
end
Expand Down
Expand Up @@ -29,7 +29,7 @@

it 'uses strong parameters' do
login(admin_user)
is_expected.to permit(:arch, :repotype, :url, :repository_id, :archfilter, :masterurl, :mastersslfingerprint, :pubkey).
expect(subject).to permit(:arch, :repotype, :url, :repository_id, :archfilter, :masterurl, :mastersslfingerprint, :pubkey).
for(:create, params: { params: dod_parameters }).on(:download_repository)
end

Expand Down
4 changes: 2 additions & 2 deletions src/api/spec/controllers/webui/project_controller_spec.rb
Expand Up @@ -747,12 +747,12 @@
it 'redirects to back if a referer is there' do
request.env['HTTP_REFERER'] = root_url # Needed for the redirect_to :back
get :toggle_watch, params: { project: user.home_project }
is_expected.to redirect_to(root_url)
expect(subject).to redirect_to(root_url)
end

it 'redirects to project#show' do
get :toggle_watch, params: { project: user.home_project }
is_expected.to redirect_to(project_show_path(user.home_project))
expect(subject).to redirect_to(project_show_path(user.home_project))
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/jobs/update_packages_if_dirty_job_spec.rb
Expand Up @@ -24,7 +24,7 @@
subject { UpdatePackagesIfDirtyJob.new.perform(123) }

it 'returns nil' do
is_expected.to be_nil
expect(subject).to be_nil
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions src/api/spec/models/bs_request_spec.rb
Expand Up @@ -436,7 +436,7 @@
subject { submit_request.forward_to(project: user.home_project.name) }

it 'creates a new submit request open for review' do
is_expected.to have_attributes(state: :review, priority: 'moderate')
expect(subject).to have_attributes(state: :review, priority: 'moderate')
end

it 'creates a submit request action with the correct target' do
Expand Down Expand Up @@ -483,7 +483,7 @@
end

it 'sets the given description' do
is_expected.to have_attributes(description: 'my description')
expect(subject).to have_attributes(description: 'my description')
end

it 'creates a submit request action with the correct target' do
Expand Down Expand Up @@ -611,7 +611,7 @@
subject { submit_request.as_json }

it 'returns a json representation of a bs request' do
is_expected.to include(
expect(subject).to include(
'id' => submit_request.id,
'number' => submit_request.number,
'creator' => submit_request.creator,
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/models/issue_tracker_spec.rb
Expand Up @@ -52,7 +52,7 @@
end

it 'returns nil' do
is_expected.to be_nil
expect(subject).to be_nil
end
end
end
Expand Down
16 changes: 8 additions & 8 deletions src/api/spec/models/kiwi/repository_spec.rb
Expand Up @@ -28,15 +28,15 @@
it { is_expected.to validate_presence_of(:source_path).with_message(/can't be nil/) }

it 'obsrepositories should be valid' do
is_expected.to allow_value('obsrepositories:/').for(:source_path)
expect(subject).to allow_value('obsrepositories:/').for(:source_path)
end

['dir', 'iso', 'smb', 'this'].each do |protocol|
it 'valid' do
property_of do
protocol + '://' + sized(range(1, 199)) { string(/./) }
end.check(3) do |string|
is_expected.to allow_value(string).for(:source_path)
expect(subject).to allow_value(string).for(:source_path)
end
end
end
Expand All @@ -47,7 +47,7 @@
# TODO: improve regular expression to generate the URI
protocol + '://' + sized(range(1, 199)) { string(/[\w]/) }
end.check(3) do |string|
is_expected.to allow_value(string).for(:source_path)
expect(subject).to allow_value(string).for(:source_path)
end
end
end
Expand All @@ -65,7 +65,7 @@
path = "obs://#{project.join(':')}/#{repository.join(':')}"
path
end.check(3) do |string|
is_expected.to allow_value(string).for(:source_path)
expect(subject).to allow_value(string).for(:source_path)
end
end

Expand All @@ -82,7 +82,7 @@
guard !['ftp', 'http', 'https', 'plain', 'dir', 'iso', 'smb', 'this', 'obs'].include?(string[0..index - 1])
string
end.check(3) do |string|
is_expected.not_to allow_value(string).for(:source_path)
expect(subject).not_to allow_value(string).for(:source_path)
end
end

Expand All @@ -95,7 +95,7 @@
string[index] = uri_character
protocol + '://' + string
end.check(3) do |string|
is_expected.not_to allow_value(string).for(:source_path)
expect(subject).not_to allow_value(string).for(:source_path)
end
end
end
Expand All @@ -113,8 +113,8 @@
# Remove `.on(:save)` when it's solved.
it { is_expected.to validate_inclusion_of(:repo_type).in_array(Kiwi::Repository::REPO_TYPES).on(:save) }
it do
is_expected.to validate_numericality_of(:priority).is_greater_than_or_equal_to(0).is_less_than(100)
.with_message(/must be between 0 and 99/)
expect(subject).to validate_numericality_of(:priority).is_greater_than_or_equal_to(0).is_less_than(100)
.with_message(/must be between 0 and 99/)
end
it { is_expected.to validate_numericality_of(:order).is_greater_than_or_equal_to(1) }
it { is_expected.to allow_value(nil).for(:imageinclude) }
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/models/obs_factory/staging_project_spec.rb
Expand Up @@ -46,7 +46,7 @@
let!(:project) { create(:project, name: 'openSUSE:Factory:Staging:42') }

it 'returns the staging project' do
is_expected.to be_kind_of(ObsFactory::StagingProject)
expect(subject).to be_kind_of(ObsFactory::StagingProject)
expect(subject.name).to eq('openSUSE:Factory:Staging:42')
expect(subject.project).to eq(project)
expect(subject.distribution).to eq(factory_distribution)
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/models/project/subprojects_spec.rb
Expand Up @@ -28,7 +28,7 @@
subject { subproject.possible_ancestor_names }

it 'returns an ordered list of possible parent project names' do
is_expected.to contain_exactly('A', 'A:B', 'A:B:C')
expect(subject).to contain_exactly('A', 'A:B', 'A:B:C')
expect(subject[0]).to eq('A:B:C')
expect(subject[1]).to eq('A:B')
expect(subject[2]).to eq('A')
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/models/project_spec.rb
Expand Up @@ -13,7 +13,7 @@

describe 'validations' do
it {
is_expected.to validate_inclusion_of(:kind).
expect(subject).to validate_inclusion_of(:kind).
in_array(['standard', 'maintenance', 'maintenance_incident', 'maintenance_release'])
}
it { is_expected.to validate_length_of(:name).is_at_most(200) }
Expand Down
18 changes: 9 additions & 9 deletions src/api/spec/models/user_ldap_strategy_spec.rb
Expand Up @@ -215,7 +215,7 @@
subject! { UserLdapStrategy.find_with_ldap('tux', 'tux_password') }

it 'returns nil because the user was not found' do
is_expected.to be_nil
expect(subject).to be_nil
end
end

Expand All @@ -232,7 +232,7 @@
subject! { UserLdapStrategy.find_with_ldap('tux', 'tux_password') }

it 'returns nil because the user was not found' do
is_expected.to be_nil
expect(subject).to be_nil
end
end

Expand All @@ -250,7 +250,7 @@
subject! { UserLdapStrategy.find_with_ldap('tux', 'tux_password') }

it 'returns nil' do
is_expected.to be_nil
expect(subject).to be_nil
end
end

Expand All @@ -268,7 +268,7 @@
subject! { UserLdapStrategy.find_with_ldap('tux', 'tux_password') }

it 'returns nil' do
is_expected.to be_nil
expect(subject).to be_nil
end
end

Expand All @@ -286,7 +286,7 @@
subject! { UserLdapStrategy.find_with_ldap('tux', 'tux_password') }

it 'returns nil' do
is_expected.to be_nil
expect(subject).to be_nil
end
end

Expand All @@ -303,7 +303,7 @@
subject! { UserLdapStrategy.find_with_ldap('tux', nil) }

it 'returns nil' do
is_expected.to be_nil
expect(subject).to be_nil
end
end

Expand All @@ -317,7 +317,7 @@
subject! { UserLdapStrategy.find_with_ldap('tux', 'tux_password') }

it 'returns name and username' do
is_expected.to eq(['John', 'tux'])
expect(subject).to eq(['John', 'tux'])
end
end

Expand Down Expand Up @@ -345,7 +345,7 @@
subject! { UserLdapStrategy.find_with_ldap('tux', 'tux_password') }

it 'returns empty string and username' do
is_expected.to eq(['', 'tux'])
expect(subject).to eq(['', 'tux'])
end
end

Expand All @@ -363,7 +363,7 @@
subject! { UserLdapStrategy.find_with_ldap('tux', 'tux_password') }

it 'returns the users ldap_name_attr and username' do
is_expected.to eq(['John', 'S'])
expect(subject).to eq(['John', 'S'])
end
end

Expand Down

0 comments on commit 4229725

Please sign in to comment.