spec/views/pugin/components/_status.html.haml_spec.rb in pugin-0.6.4 vs spec/views/pugin/components/_status.html.haml_spec.rb in pugin-0.7.0
- old
+ new
@@ -4,18 +4,12 @@
describe 'pugin/components/_status.html.haml', type: :view do
context 'while not in a dissolution' do
before :each do
- module FlagHelper
- def self.dissolution?
- false
- end
- def self.register_to_vote?
- false
- end
- end
+ allow(Pugin::Feature::Bandiera).to receive(:dissolution?).and_return(false)
+ allow(Pugin::Feature::Bandiera).to receive(:register_to_vote?).and_return(false)
end
it 'renders a message not related to the dissolution' do
render partial: 'pugin/components/status', locals: { status: nil }
@@ -36,18 +30,12 @@
end
context 'while in a dissolution and still able to register to vote' do
before :each do
- module FlagHelper
- def self.dissolution?
- true
- end
- def self.register_to_vote?
- true
- end
- end
+ allow(Pugin::Feature::Bandiera).to receive(:dissolution?).and_return(true)
+ allow(Pugin::Feature::Bandiera).to receive(:register_to_vote?).and_return(true)
end
it 'renders a message that shows a link to register to vote' do
render partial: 'pugin/components/status', locals: { status: nil }
expect(response).to eq(
@@ -69,17 +57,11 @@
end
context 'while in a dissolution and registration has closed' do
before :each do
- module FlagHelper
- def self.dissolution?
- true
- end
- def self.register_to_vote?
- false
- end
- end
+ allow(Pugin::Feature::Bandiera).to receive(:dissolution?).and_return(true)
+ allow(Pugin::Feature::Bandiera).to receive(:register_to_vote?).and_return(false)
end
it 'renders a message that reminds the user of the general election date' do
render partial: 'pugin/components/status', locals: { status: nil }