Permalink
Browse files

Properly check for submissions#[index,show] and select the button. Close

 #99.
  • Loading branch information...
1 parent a97db42 commit 4fd84606bc5c0b8dddd8a6c5925e123ca7dbb44d @bamnet bamnet committed Jun 5, 2012
Showing with 13 additions and 1 deletion.
  1. +1 −1 app/views/elements/_topmenu_contents.html.erb
  2. +1 −0 test/fixtures/users.yml
  3. +11 −0 test/integration/root_test.rb
@@ -13,7 +13,7 @@
<!-- Begin Menu for CONTENT -->
<section>
<div class="TM-sectop">
- <%= link_to feeds_path, :class => "btn #{ current_page?(feeds_path) || current_page?(:controller => 'submissions', :action => 'index') || current_page?(:controller => 'submissions', :action => 'show') ? 'selected' : '' }" do %><%= t(:browse) %><% end %>
+ <%= link_to feeds_path, :class => "btn #{ current_page?(feeds_path) || (controller.controller_name == 'submissions' && ['index', 'show'].include?(controller.action_name)) ? 'selected' : '' }" do %><%= t(:browse) %><% end %>
<%= link_to new_content_path, :class => "btn #{ current_page?(new_content_path) ? 'selected' : '' }" do %><%= t(:add) %><% end %>
</div>
<div class="TM-secbot">
View
@@ -9,6 +9,7 @@ katie:
first_name: Katie
last_name: Boudreau
email: ktb@test.com
+ encrypted_password: $2a$10$UFJS15eVQKdSyP5qU7K.ceS0lqh5MUHt3DoyidIW70QUTVmPd3w4O
kristen:
first_name: Kristen
@@ -12,4 +12,15 @@ class RootTest < ActionController::IntegrationTest
# And it should never ever ever redirect
assert !redirect?
end
+
+ test "signed in root urls load" do
+ post "/users/sign_in", :user => {:email => users(:katie).email, :password => 'katie'}
+ assert :success
+
+ get "/feeds"
+ assert :success
+
+ get "/feeds/#{feeds(:service).id}/submissions"
+ assert :success
+ end
end

0 comments on commit 4fd8460

Please sign in to comment.