Add DemoController tests
This commit is contained in:
parent
71bd708ffd
commit
502f41657b
1 changed files with 18 additions and 0 deletions
18
spec/controllers/demo_controller_spec.rb
Normal file
18
spec/controllers/demo_controller_spec.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
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
|
Loading…
Reference in a new issue