Skip to content

Commit

Permalink
starting to build up admin area menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Emerson Lackey committed Nov 15, 2011
1 parent 5057e0a commit 2a9fb9e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
6 changes: 2 additions & 4 deletions app/views/layouts/admin.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
<%= link_to ApplicationSettings.config['application_name'], root_path, {:class => 'brand'} %>

<ul class="nav">
<li class="active"><%= link_to 'Home', root_path %></li>
<% if ApplicationSettings.config['user_registration'] && !current_user %>
<li><%= link_to 'Signup', signup_path %></li>
<% end %>
<li><%= link_to 'Home', root_path %></li>
<li class="users active"><%= link_to 'User', admin_users_path %></li>
</ul>

<% if current_user == nil %>
Expand Down
7 changes: 6 additions & 1 deletion features/admin_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ Scenario: Admin Layout
Given I have a valid and confirmed admin user
And I am on the homepage
And I login
Then I should see the admin layout
Then I should see the admin layout

Scenario: Admin Menu
Given I am logged in as an admin user
And I am on the homepage
Then I should see the admin menu
15 changes: 14 additions & 1 deletion features/step_definitions/admin_users_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,22 @@
visit root_path
fill_in 'email', :with => @user.email
fill_in 'password', :with => 'password'
click_button('login');
click_button('login')
end

Then /^I should see the admin layout$/ do
assert page.has_selector?('body.admin'), "Body missing the admin class"
end

Given /^I am logged in as an admin user$/ do
user = Factory.create(:admin)
visit root_path
fill_in 'email', :with => user.email
fill_in 'password', :with => 'password'
click_button('login')
end

Then /^I should see the admin menu$/ do
visit admin_root_path
assert page.has_selector?('ul.nav li.users')
end

0 comments on commit 2a9fb9e

Please sign in to comment.