add api token in administrator's profile page
This commit is contained in:
parent
cea90384e4
commit
d2978c4656
4 changed files with 24 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
class Admin::ProfileController < ApplicationController
|
||||
class Admin::ProfileController < AdminController
|
||||
def show
|
||||
|
||||
@administrateur = current_administrateur
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1 +1,6 @@
|
|||
#profile_page
|
||||
#profile_page
|
||||
%h2 Profile
|
||||
%hr
|
||||
%p
|
||||
API TOKEN :
|
||||
= @administrateur.api_token
|
5
spec/controllers/admin/profile_controller_spec.rb
Normal file
5
spec/controllers/admin/profile_controller_spec.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Admin::ProfileController, type: :controller do
|
||||
it { expect(described_class).to be < AdminController }
|
||||
end
|
11
spec/views/admin/profile/show.html.haml_spec.rb
Normal file
11
spec/views/admin/profile/show.html.haml_spec.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue