|
|
|
@ -47,6 +47,17 @@ describe MyController, :type => :controller do |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe 'with disabled password login' do |
|
|
|
|
before do |
|
|
|
|
OmniauthLogin.stub(:disable_password_login?).and_return(true) |
|
|
|
|
post :change_password |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'is not found' do |
|
|
|
|
expect(response.status).to eq 404 |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe 'with wrong confirmation' do |
|
|
|
|
before do |
|
|
|
|
post :change_password, :password => 'adminADMIN!', |
|
|
|
@ -124,6 +135,25 @@ describe MyController, :type => :controller do |
|
|
|
|
it "renders editable custom fields" do |
|
|
|
|
expect(response.body).to have_content(custom_field.name) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "renders the 'Change password' menu entry" do |
|
|
|
|
expect(response.body).to have_selector('#menu-sidebar li a', text: 'Change password') |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe 'account with disabled password login' do |
|
|
|
|
before do |
|
|
|
|
OmniauthLogin.stub(:disable_password_login?).and_return(true) |
|
|
|
|
as_logged_in_user user do |
|
|
|
|
get :account |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
render_views |
|
|
|
|
|
|
|
|
|
it "does not render 'Change password' menu entry" do |
|
|
|
|
expect(response.body).not_to have_selector('#menu-sidebar li a', text: 'Change password') |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|