Last active
January 4, 2016 18:09
-
-
Save benlieb/8658702 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "handling GET /authors/new" do | |
def do_get | |
get :new, :id => "1" | |
end | |
it "should render record_not_found" do | |
get :new, :id => "1" | |
controller.should_receive(:page_not_found) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
def page_not_found | |
ap "-------3" | |
respond_to do |format| | |
format.html do | |
ap "-------4" | |
render :file => File.join(RAILS_ROOT,"app","views","shared","page_not_found.html.erb"), :layout => true | |
end | |
format.xml do | |
format.xml { head :record_not_found } | |
end | |
end | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/benlieb/.rvm/gems/[email protected]_rails_4/gems/actionpack-4.0.2/lib/action_dispatch/http/mime_type.rb:166: warning: already initialized constant Mime::ZIP | |
/Users/benlieb/.rvm/gems/[email protected]_rails_4/gems/actionpack-4.0.2/lib/action_dispatch/http/mime_type.rb:166: warning: previous definition of ZIP was here | |
Run options: include {:focus=>true} | |
"-------1" | |
"-------3" | |
"-------4" | |
. | |
Finished in 0.03103 seconds | |
1 example, 0 failures | |
Randomized with seed 63699 | |
[email protected] 02:47 PM ~/my_life/sites/2013/CSEE/apps/csee.org > | |
$ rspec --tag focus spec/controllers/authors_controller_spec.rb | |
/Users/benlieb/.rvm/gems/[email protected]_rails_4/gems/actionpack-4.0.2/lib/action_dispatch/http/mime_type.rb:166: warning: already initialized constant Mime::ZIP | |
/Users/benlieb/.rvm/gems/[email protected]_rails_4/gems/actionpack-4.0.2/lib/action_dispatch/http/mime_type.rb:166: warning: previous definition of ZIP was here | |
Run options: include {:focus=>true} | |
"-------1" | |
"-------2" | |
F | |
Failures: | |
1) AuthorsController handling GET /authors/new should render record_not_found | |
Failure/Error: get :new, :id => "1" | |
ActionView::MissingTemplate: | |
Missing template authors/new, application/new with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder, :haml]}. Searched in: | |
* "#<RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator:0x007fdb36339dc0>" | |
# ./spec/controllers/authors_controller_spec.rb:162:in `do_get' | |
# ./spec/controllers/authors_controller_spec.rb:167:in `block (3 levels) in <top (required)>' | |
Finished in 0.02915 seconds | |
1 example, 1 failure | |
Failed examples: | |
rspec ./spec/controllers/authors_controller_spec.rb:165 # AuthorsController handling GET /authors/new should render record_not_found | |
Randomized with seed 29334 | |
[email protected] 02:48 PM ~/my_life/sites/2013/CSEE/apps/csee.org > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment