Sha256: 63f6874053cc3d4458604dfff810425452801a6d0fa9d9b6306024746093d14c
Contents?: true
Size: 797 Bytes
Versions: 1
Compression:
Stored size: 797 Bytes
Contents
require 'spec_helper' describe Spree::Admin::NewslettersController, type: :controller do stub_authorization! before do SolidusNewsletter::Config[:title] = 'Newsletter' SolidusNewsletter::Config[:text] = 'Gets 10%' end context '#update' do it 'returns true' do put :update, params: { newsletters: { title: 'Newsletter Test', text: 'Gets 20%' } } expect(response.status).to eq(302) expect(SolidusNewsletter::Config[:title]).to eq('Newsletter Test') expect(SolidusNewsletter::Config[:text]).to eq('Gets 20%') end it 'returns false' do put :update, params: { newsletters: { title: '', text: '' } } expect(response.status).to eq(302) expect(flash[:error]).to include('Something went wrong, please try again') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
solidus_newsletter-1.0 | spec/controllers/spree/admin/newsletters_controller_spec.rb |