remove env dependence in spec
This commit is contained in:
parent
1dcfb2509f
commit
29dacb4686
1 changed files with 11 additions and 3 deletions
|
@ -1,10 +1,18 @@
|
||||||
describe AgentConnect::AgentController, type: :controller do
|
describe AgentConnect::AgentController, type: :controller do
|
||||||
describe '#login' do
|
describe '#login' do
|
||||||
before { get :login }
|
let(:uri) { 'https://agent-connect.fr' }
|
||||||
|
let(:state) { 'state' }
|
||||||
|
let(:nonce) { 'nonce' }
|
||||||
|
|
||||||
|
before do
|
||||||
|
expect(AgentConnectService).to receive(:authorization_uri).and_return([uri, state, nonce])
|
||||||
|
get :login
|
||||||
|
end
|
||||||
|
|
||||||
it do
|
it do
|
||||||
expect(state_cookie).not_to be_nil
|
expect(state_cookie).to eq(state)
|
||||||
expect(nonce_cookie).not_to be_nil
|
expect(nonce_cookie).to eq(nonce)
|
||||||
|
expect(response).to redirect_to(uri)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue