Merge branch 'registry-475-refactor-zones' into registry-475

This commit is contained in:
Artur Beljajev 2017-05-03 13:25:13 +03:00
commit 8e94a3d24b
2 changed files with 4 additions and 4 deletions

View file

@ -17,20 +17,20 @@ RSpec.describe 'admin zone create', settings: false do
text_attributes.each do |attr_name|
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')
end
end
integer_attributes.each do |attr_name|
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)
end
end
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
end
end

View file

@ -33,7 +33,7 @@ RSpec.describe 'admin zone update', settings: false do
it 'redirects to :index' do
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
end