Fix page title for failed trace updates
This commit is contained in:
parent
2666294abb
commit
9ed6a9d779
2 changed files with 12 additions and 1 deletions
|
@ -143,7 +143,7 @@ class TracesController < ApplicationController
|
||||||
flash[:notice] = t ".updated"
|
flash[:notice] = t ".updated"
|
||||||
redirect_to :action => "show", :display_name => current_user.display_name
|
redirect_to :action => "show", :display_name => current_user.display_name
|
||||||
else
|
else
|
||||||
@title = t ".title", :name => @trace.name
|
@title = t "traces.edit.title", :name => @trace.name
|
||||||
render :action => "edit"
|
render :action => "edit"
|
||||||
end
|
end
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
|
|
@ -667,6 +667,17 @@ class TracesControllerTest < ActionDispatch::IntegrationTest
|
||||||
assert_equal new_details[:visibility], trace.visibility
|
assert_equal new_details[:visibility], trace.visibility
|
||||||
end
|
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
|
# Test destroying a trace
|
||||||
def test_destroy
|
def test_destroy
|
||||||
public_trace_file = create(:trace, :visibility => "public")
|
public_trace_file = create(:trace, :visibility => "public")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue