Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/assets/javascripts/users.js.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jQuery ->
$('nav_profile').scrollspy({offset: 50})
$('nav_posix_settings').scrollspy({offset: 50})

5 changes: 5 additions & 0 deletions app/views/users/_posix_fields.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
%h1#nav_posix_settings.section=t :posix_settings, :scope => :user_form
= f.fields_for :posix_settings do |p|
#shell.text_input
= p.label :login_shell
= p.select :login_shell, {"/bin/bash" => :bash}
3 changes: 3 additions & 0 deletions app/views/users/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
%ul#nav_profile.menu.nav.nav-pills.nav-stacked
= menu_item t(:password, :scope => :user_form), '#password_fields'
= menu_item t(:git_config, :scope => :user_form), '#git_config_fields'
= menu_item t(:posix_settings, :scope => :user_form), '#posix_settings_fields'

#page_content
- unless @user.nil?
Expand All @@ -12,5 +13,7 @@
#git_config_fields
= f.fields_for :git_config do |git_config|
=render :partial => '/git_configs/fields', :locals => { :f => git_config }
#posix_settings_fields
=render :partial => 'posix_fields', :locals => { :f => f }
#buttons
= f.submit
5 changes: 5 additions & 0 deletions features/step_definitions/web_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
page.should_not have_content(text)
end

When /^I visit my account settings page$/ do
@user = User.find_by_nick("Robert")
visit edit_user_path(@user)
end

When /^I go the home page$/ do
visit '/'
end
Expand Down
13 changes: 13 additions & 0 deletions features/user_change_shell.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Change shell for a user

In order to let everybody decide about their own shell
as a user with a posix account
I want be able to change my shell.

Scenario: show default shell
Given a user "Robert"
And I am logged in as "Robert"
When I visit my account settings page
Then I should see "Login shell"
And I should see "/bin/bash"

23 changes: 23 additions & 0 deletions spec/views/users/posix_fields.html.haml_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'spec_helper'

describe "users/edit.html.haml" do
describe "users/_posix_fields.html.haml" do
before(:each) do
gc = mock_model(GitConfig, :name => "", :email => "")
u = mock_model(User, :email => "", :git_config => gc)
assign :user, u
end

it "should provide a section for posix settings" do
render
rendered.should have_css("h1.section", :text => "Posix Settings")
end

it "should have a field for the shell" do
render
rendered.should have_css("form label", :text => "Login shell")
rendered.should have_css("form select#user_posix_settings_login_shell")
end
end
end