Move browse#new_note to notes#new
This allows a more resourceful routing approach.
This commit is contained in:
parent
f7367baa6b
commit
b5046fdcd0
6 changed files with 22 additions and 14 deletions
|
@ -36,10 +36,6 @@ class BrowseControllerTest < ActionDispatch::IntegrationTest
|
|||
{ :path => "/note/1", :method => :get },
|
||||
{ :controller => "browse", :action => "note", :id => "1" }
|
||||
)
|
||||
assert_routing(
|
||||
{ :path => "/note/new", :method => :get },
|
||||
{ :controller => "browse", :action => "new_note" }
|
||||
)
|
||||
assert_routing(
|
||||
{ :path => "/query", :method => :get },
|
||||
{ :controller => "browse", :action => "query" }
|
||||
|
@ -256,12 +252,6 @@ class BrowseControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_select ".browse-section.browse-relation", 2
|
||||
end
|
||||
|
||||
def test_new_note
|
||||
get note_new_path
|
||||
assert_response :success
|
||||
assert_template "browse/new_note"
|
||||
end
|
||||
|
||||
def test_query
|
||||
get query_path
|
||||
assert_response :success
|
||||
|
|
|
@ -15,6 +15,11 @@ class NotesControllerTest < ActionDispatch::IntegrationTest
|
|||
{ :path => "/user/username/notes", :method => :get },
|
||||
{ :controller => "notes", :action => "index", :display_name => "username" }
|
||||
)
|
||||
|
||||
assert_routing(
|
||||
{ :path => "/note/new", :method => :get },
|
||||
{ :controller => "notes", :action => "new" }
|
||||
)
|
||||
end
|
||||
|
||||
def test_index_success
|
||||
|
@ -80,4 +85,10 @@ class NotesControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_response :success
|
||||
assert_select "h4", :html => "No notes"
|
||||
end
|
||||
|
||||
def test_new_note
|
||||
get new_note_path
|
||||
assert_response :success
|
||||
assert_template "notes/new"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue