Browse files

clearing leftover whitespace

  • Loading branch information...
1 parent 9448041 commit 112a9953276a960f788f19f3e2792ccaf1cadee5 @ryanb committed Jun 19, 2012
View
6 spec/cancan/ability_spec.rb
@@ -305,15 +305,15 @@ class A; include B; end
@ability.can?(:read, "foobar" => Range).should be_false
@ability.can?(:read, 123 => Range).should be_true
end
-
+
it "passing a hash of subjects with multiple definitions should check permissions correctly" do
@ability.can :read, Range, :string => {:length => 4}
@ability.can [:create, :read], Range, :string => {:upcase => 'FOO'}
@ability.can?(:read, "foo" => Range).should be_true
@ability.can?(:read, "foobar" => Range).should be_false
@ability.can?(:read, 1234 => Range).should be_true
- end
-
+ end
+
it "should allow to check ability on Hash-like object" do
class Container < Hash; end
@ability.can :read, Container
View
8 spec/cancan/exceptions_spec.rb
@@ -32,23 +32,23 @@
@exception.message.should == "Access denied!"
end
end
-
+
describe "i18n in the default message" do
after(:each) do
I18n.backend = nil
end
-
+
it "uses i18n for the default message" do
I18n.backend.store_translations :en, :unauthorized => {:default => "This is a different message"}
@exception = CanCan::AccessDenied.new
@exception.message.should == "This is a different message"
end
-
+
it "defaults to a nice message" do
@exception = CanCan::AccessDenied.new
@exception.message.should == "You are not authorized to access this page."
end
-
+
it "does not use translation if a message is given" do
@exception = CanCan::AccessDenied.new("Hey! You're not welcome here")
@exception.message.should == "Hey! You're not welcome here"
View
2 spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -133,7 +133,7 @@
article1 = Article.create!(:secret => true, :category => category1)
article2 = Article.create!(:secret => true, :category => category2)
category1.articles.accessible_by(@ability).should == [article1]
- end
+ end
it "should raise an exception when trying to merge scope with other conditions" do
@ability.can :read, Article, :published => true

0 comments on commit 112a995

Please sign in to comment.