Permalink
Browse files

Added failing test which assets that defined controller should be ano…

…nymous if created

from a controller that is specified as abstract!.
  • Loading branch information...
1 parent 525ed7a commit 6ee788825fd428addd6ca595da2ab9a53ad57114 @thomasfedb thomasfedb committed Jan 5, 2014
Showing with 7 additions and 0 deletions.
  1. +7 −0 spec/rspec/rails/example/controller_example_group_spec.rb
@@ -1,6 +1,7 @@
require "spec_helper"
class ::ApplicationController
+ def self.abstract?; false; end
end
module RSpec::Rails
@@ -119,6 +120,12 @@ module RSpec::Rails
group.controller(ApplicationController) { }
expect(controller_class.name).to eq "AnonymousController"
end
+
+ it "sets name as AnonymousController the controller is abstract" do
+ stub_const "BarsController", Class.new(::ApplicationController) { def self.abstract?; true; end }
+ group.controller(BarsController) { }
+ expect(controller_class.name).to eq "AnonymousController"
+ end
end
end
end

0 comments on commit 6ee7888

Please sign in to comment.