flash[:notice] = t ".updated"
redirect_to :action => "show", :display_name => current_user.display_name
else
- @title = t ".title", :name => @trace.name
+ @title = t "traces.edit.title", :name => @trace.name
render :action => "edit"
end
rescue ActiveRecord::RecordNotFound
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")