demarches-normaliennes/spec/controllers/demo_controller_spec.rb
2017-06-13 10:35:23 +02:00

17 lines
414 B
Ruby

require 'spec_helper'
describe DemoController, type: :controller do
describe 'GET #index' do
subject { get :index }
it { expect(subject.status).to eq 200 }
context 'when rails environnement is production' do
before do
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production"))
end
it { expect(subject.status).to eq 302 }
end
end
end