Skip to content

Commit

Permalink
Properly check for submissions#[index,show] and select the button. Close
Browse files Browse the repository at this point in the history
 #99.
  • Loading branch information
bamnet committed Jun 5, 2012
1 parent a97db42 commit 4fd8460
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/elements/_topmenu_contents.html.erb
Expand Up @@ -13,7 +13,7 @@
<!-- Begin Menu for CONTENT --> <!-- Begin Menu for CONTENT -->
<section> <section>
<div class="TM-sectop"> <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 %> <%= link_to new_content_path, :class => "btn #{ current_page?(new_content_path) ? 'selected' : '' }" do %><%= t(:add) %><% end %>
</div> </div>
<div class="TM-secbot"> <div class="TM-secbot">
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/users.yml
Expand Up @@ -9,6 +9,7 @@ katie:
first_name: Katie first_name: Katie
last_name: Boudreau last_name: Boudreau
email: ktb@test.com email: ktb@test.com
encrypted_password: $2a$10$UFJS15eVQKdSyP5qU7K.ceS0lqh5MUHt3DoyidIW70QUTVmPd3w4O


kristen: kristen:
first_name: Kristen first_name: Kristen
Expand Down
11 changes: 11 additions & 0 deletions test/integration/root_test.rb
Expand Up @@ -12,4 +12,15 @@ class RootTest < ActionController::IntegrationTest
# And it should never ever ever redirect # And it should never ever ever redirect
assert !redirect? assert !redirect?
end 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 end

0 comments on commit 4fd8460

Please sign in to comment.