mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
Merge branch 'registry-475-refactor-zones' into registry-475
This commit is contained in:
commit
8e94a3d24b
2 changed files with 4 additions and 4 deletions
|
@ -17,20 +17,20 @@ RSpec.describe 'admin zone create', settings: false do
|
||||||
|
|
||||||
text_attributes.each do |attr_name|
|
text_attributes.each do |attr_name|
|
||||||
it "saves #{attr_name}" do
|
it "saves #{attr_name}" do
|
||||||
post admin_zones_path, { zone: attributes_for(:zone, attr_name => 'test') }
|
post admin_zones_path, zone: attributes_for(:zone, attr_name => 'test')
|
||||||
expect(zone.send(attr_name)).to eq('test')
|
expect(zone.send(attr_name)).to eq('test')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
integer_attributes.each do |attr_name|
|
integer_attributes.each do |attr_name|
|
||||||
it "saves #{attr_name}" do
|
it "saves #{attr_name}" do
|
||||||
post admin_zones_path, { zone: attributes_for(:zone, attr_name => '1') }
|
post admin_zones_path, zone: attributes_for(:zone, attr_name => '1')
|
||||||
expect(zone.send(attr_name)).to eq(1)
|
expect(zone.send(attr_name)).to eq(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'redirects to :index' do
|
it 'redirects to :index' do
|
||||||
post admin_zones_path, { zone: attributes_for(:zone) }
|
post admin_zones_path, zone: attributes_for(:zone)
|
||||||
expect(response).to redirect_to admin_zones_url
|
expect(response).to redirect_to admin_zones_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,7 +33,7 @@ RSpec.describe 'admin zone update', settings: false do
|
||||||
it 'redirects to :index' do
|
it 'redirects to :index' do
|
||||||
zone = create(:zone)
|
zone = create(:zone)
|
||||||
|
|
||||||
patch admin_zone_path(zone), { zone: attributes_for(:zone) }
|
patch admin_zone_path(zone), zone: attributes_for(:zone)
|
||||||
|
|
||||||
expect(response).to redirect_to admin_zones_url
|
expect(response).to redirect_to admin_zones_url
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue