add api token in administrator's profile page

This commit is contained in:
Tanguy PATTE 2015-12-15 16:49:48 +01:00
parent cea90384e4
commit d2978c4656
4 changed files with 24 additions and 3 deletions

View file

@ -1,5 +1,5 @@
class Admin::ProfileController < ApplicationController
class Admin::ProfileController < AdminController
def show
@administrateur = current_administrateur
end
end

View file

@ -1 +1,6 @@
#profile_page
%h2 Profile
%hr
%p
API TOKEN :
= @administrateur.api_token

View file

@ -0,0 +1,5 @@
require 'spec_helper'
describe Admin::ProfileController, type: :controller do
it { expect(described_class).to be < AdminController }
end

View file

@ -0,0 +1,11 @@
require 'spec_helper'
describe 'admin/profile/show.html.haml', type: :view do
let(:token) { 'super_token' }
let(:admin) { create(:administrateur, api_token: token) }
before do
assign(:administrateur, admin)
render
end
it { expect(rendered).to have_content(token) }
end