Commit ccb17f83 authored by Jason Goodman's avatar Jason Goodman

Apply 2 suggestion(s) to 1 file(s)

parent 548b6184
...@@ -31,11 +31,9 @@ RSpec.describe GroupsController, type: :request do ...@@ -31,11 +31,9 @@ RSpec.describe GroupsController, type: :request do
context 'valid param' do context 'valid param' do
shared_examples 'creates ip restrictions' do shared_examples 'creates ip restrictions' do
it 'creates ip restrictions' do it 'creates ip restrictions' do
expect(group.ip_restrictions).to be_empty expect { subject }
.to change { group.reload.ip_restrictions.map(&:range) }
subject .from([]).to(contain_exactly(*range.split(',')))
expect(group.reload.ip_restrictions.map(&:range)).to contain_exactly(*range.split(','))
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:found)
end end
end end
...@@ -73,11 +71,9 @@ RSpec.describe GroupsController, type: :request do ...@@ -73,11 +71,9 @@ RSpec.describe GroupsController, type: :request do
context 'valid param' do context 'valid param' do
shared_examples 'updates ip restrictions' do shared_examples 'updates ip restrictions' do
it 'updates ip restrictions' do it 'updates ip restrictions' do
expect(group.ip_restrictions.map(&:range)).to eq(['10.0.0.0/8']) expect { subject }
.to change { group.reload.ip_restrictions.map(&:range) }
subject .from(['10.0.0.0/8']).to(contain_exactly(*range.split(',')))
expect(group.reload.ip_restrictions.map(&:range)).to contain_exactly(*range.split(','))
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:found)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment