demarches-normaliennes/spec/controllers/admin/profile_controller_spec.rb
2017-12-26 18:30:36 +01:00

16 lines
467 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