demarches-normaliennes/spec/controllers/admin/profile_controller_spec.rb
2018-03-06 17:18:44 +01:00

16 lines
468 B
Ruby

require 'spec_helper'
describe Admin::ProfileController, type: :controller do
it { expect(described_class).to be < AdminController }
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
end