2015-12-15 16:49:48 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Admin::ProfileController, type: :controller do
|
|
|
|
it { expect(described_class).to be < AdminController }
|
2017-12-26 18:30:36 +01:00
|
|
|
let(:administrateur) { create(:administrateur) }
|
|
|
|
|
|
|
|
before { sign_in(administrateur) }
|
|
|
|
|
|
|
|
describe 'POST #renew_api_token' do
|
|
|
|
subject { post :renew_api_token }
|
|
|
|
|
|
|
|
it { expect{ subject }.to change{ administrateur.reload.api_token } }
|
|
|
|
|
|
|
|
it { subject; expect(response.status).to redirect_to(admin_profile_path) }
|
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|