demarches-normaliennes/spec/controllers/admin/profile_controller_spec.rb

17 lines
467 B
Ruby
Raw Normal View History

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
2017-04-04 15:27:04 +02:00
end