mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-17 00:07:24 +00:00
Add spec to countries_controller
This commit is contained in:
24
spec/controllers/spree/admin/countries_controller_spec.rb
Normal file
24
spec/controllers/spree/admin/countries_controller_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
module Spree
|
||||
module Admin
|
||||
describe CountriesController, type: :controller do
|
||||
include AuthenticationWorkflow
|
||||
|
||||
describe "#update" do
|
||||
before { login_as_admin }
|
||||
|
||||
it "updates the name of an existing country" do
|
||||
country = create(:country)
|
||||
spree_put :update, id: country.id,
|
||||
country: { name: "Kyrgyzstan" }
|
||||
|
||||
expect(response).to redirect_to spree.admin_countries_url
|
||||
expect(country.reload.name).to eq "Kyrgyzstan"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user