class PolymorphicControllerTest

Public Instance Methods

test_current_page_when_options_does_not_respond_to_to_hash() click to toggle source
# File actionview/test/template/url_helper_test.rb, line 963
def test_current_page_when_options_does_not_respond_to_to_hash
  @controller = WorkshopsController.new

  get :edit, params: { id: 1 }
  assert_equal "false", @response.body
end
test_existing_nested_resource() click to toggle source
# File actionview/test/template/url_helper_test.rb, line 949
def test_existing_nested_resource
  @controller = SessionsController.new

  get :show, params: { workshop_id: 1, id: 1 }
  assert_equal %{/workshops/1/sessions/1\n<a href="/workshops/1/sessions/1">Session</a>}, @response.body
end
test_existing_nested_resource_with_params() click to toggle source
# File actionview/test/template/url_helper_test.rb, line 956
def test_existing_nested_resource_with_params
  @controller = SessionsController.new

  get :edit, params: { workshop_id: 1, id: 1, format: "json"  }
  assert_equal %{/workshops/1/sessions/1.json\n<a href="/workshops/1/sessions/1.json">Session</a>}, @response.body
end
test_existing_resource() click to toggle source
# File actionview/test/template/url_helper_test.rb, line 935
def test_existing_resource
  @controller = WorkshopsController.new

  get :show, params: { id: 1 }
  assert_equal %{/workshops/1\n<a href="/workshops/1">Workshop</a>}, @response.body
end
test_new_nested_resource() click to toggle source
# File actionview/test/template/url_helper_test.rb, line 942
def test_new_nested_resource
  @controller = SessionsController.new

  get :index, params: { workshop_id: 1 }
  assert_equal %{/workshops/1/sessions\n<a href="/workshops/1/sessions">Session</a>}, @response.body
end
test_new_resource() click to toggle source
# File actionview/test/template/url_helper_test.rb, line 928
def test_new_resource
  @controller = WorkshopsController.new

  get :index
  assert_equal %{/workshops\n<a href="/workshops">Workshop</a>}, @response.body
end