Permalink
Browse files

Added scenario where a user sees a list of his/hers accounts.

  • Loading branch information...
1 parent 4664513 commit 7bbde3626ec4bf9ede84eb59b9c4ece6945f7980 Nicklas Ramhöj committed Aug 21, 2011
View
6 features/resource_scoping_as_multi_user.feature
@@ -18,3 +18,9 @@ Feature: Account scooping with a user that belongs to several accounts
Then I should see "Serenity"
And I should see "Fort Nox"
And I should not see "Expedit"
+
+ Scenario: Viewing my account
+ When I follow "My accounts"
+ Then I should see "Elabs"
+ And I should see "SEB"
+ And I should not see "IKEA"
View
2 spec/rails_app/app/views/layouts/application.html.erb
@@ -22,6 +22,8 @@
<%= link_to "Projects", projects_path %>
<%= link_to "My projects", projects_path(:my => true) %>
<%= link_to "All projects", projects_path(:all => true) %>
+
+ <%= link_to "My accounts", projects_path(:my_accounts => true) %>
<%= link_to('Sign out', destroy_user_session_path) %>
<% else %>
<%= link_to "Sign up", sign_up_accounts_path %>
View
6 spec/rails_app/app/views/projects/_my_accounts.html.erb
@@ -0,0 +1,6 @@
+<h4><%= current_user.email %>'s accounts:</h4>
+<ul>
+ <% current_user.accounts.each do |accounts| %>
+ <li><%= accounts.name %></li>
+ <% end %>
+</ul>
View
2 spec/rails_app/app/views/projects/index.html.erb
@@ -2,6 +2,8 @@
<%= render "all_projects" %>
<% elsif params[:my] %>
<%= render "my_projects" %>
+<% elsif params[:my_accounts] %>
+ <%= render "my_accounts" %>
<% else %>
<%= render "current_account_projects" %>
<% end %>

0 comments on commit 7bbde36

Please sign in to comment.