assert_select "li.page-item a.page-link", :text => "Older Traces", :count => 2
end
+ def test_index_invalid_paged
+ # Try some invalid paged accesses
+ %w[-1 0 fred].each do |id|
+ get traces_path(:before => id)
+ assert_redirected_to :controller => :errors, :action => :bad_request
+
+ get traces_path(:after => id)
+ assert_redirected_to :controller => :errors, :action => :bad_request
+ end
+ end
+
# Check the RSS feed
def test_rss
user = create(:user)
assert_equal new_details[:visibility], trace.visibility
end
+ # Test invalid updates
+ def test_update_invalid
+ trace = create(:trace)
+
+ # Invalid visibility
+ session_for(trace.user)
+ put trace_path(trace, :trace => { :description => "Changed description", :tagstring => "new_tag", :visibility => "wrong" })
+ assert_response :success
+ assert_select "title", :text => /^Editing Trace/
+ end
+
# Test destroying a trace
def test_destroy
public_trace_file = create(:trace, :visibility => "public")