clearing leftover whitespace

This commit is contained in:
Ryan Bates 2012-06-19 11:36:59 -07:00
parent 944804183e
commit 112a995327
3 changed files with 8 additions and 8 deletions

View File

@ -305,15 +305,15 @@ describe CanCan::Ability do
@ability.can?(:read, "foobar" => Range).should be_false @ability.can?(:read, "foobar" => Range).should be_false
@ability.can?(:read, 123 => Range).should be_true @ability.can?(:read, 123 => Range).should be_true
end end
it "passing a hash of subjects with multiple definitions should check permissions correctly" do it "passing a hash of subjects with multiple definitions should check permissions correctly" do
@ability.can :read, Range, :string => {:length => 4} @ability.can :read, Range, :string => {:length => 4}
@ability.can [:create, :read], Range, :string => {:upcase => 'FOO'} @ability.can [:create, :read], Range, :string => {:upcase => 'FOO'}
@ability.can?(:read, "foo" => Range).should be_true @ability.can?(:read, "foo" => Range).should be_true
@ability.can?(:read, "foobar" => Range).should be_false @ability.can?(:read, "foobar" => Range).should be_false
@ability.can?(:read, 1234 => Range).should be_true @ability.can?(:read, 1234 => Range).should be_true
end end
it "should allow to check ability on Hash-like object" do it "should allow to check ability on Hash-like object" do
class Container < Hash; end class Container < Hash; end
@ability.can :read, Container @ability.can :read, Container

View File

@ -32,23 +32,23 @@ describe CanCan::AccessDenied do
@exception.message.should == "Access denied!" @exception.message.should == "Access denied!"
end end
end end
describe "i18n in the default message" do describe "i18n in the default message" do
after(:each) do after(:each) do
I18n.backend = nil I18n.backend = nil
end end
it "uses i18n for the default message" do it "uses i18n for the default message" do
I18n.backend.store_translations :en, :unauthorized => {:default => "This is a different message"} I18n.backend.store_translations :en, :unauthorized => {:default => "This is a different message"}
@exception = CanCan::AccessDenied.new @exception = CanCan::AccessDenied.new
@exception.message.should == "This is a different message" @exception.message.should == "This is a different message"
end end
it "defaults to a nice message" do it "defaults to a nice message" do
@exception = CanCan::AccessDenied.new @exception = CanCan::AccessDenied.new
@exception.message.should == "You are not authorized to access this page." @exception.message.should == "You are not authorized to access this page."
end end
it "does not use translation if a message is given" do it "does not use translation if a message is given" do
@exception = CanCan::AccessDenied.new("Hey! You're not welcome here") @exception = CanCan::AccessDenied.new("Hey! You're not welcome here")
@exception.message.should == "Hey! You're not welcome here" @exception.message.should == "Hey! You're not welcome here"

View File

@ -133,7 +133,7 @@ if ENV["MODEL_ADAPTER"].nil? || ENV["MODEL_ADAPTER"] == "active_record"
article1 = Article.create!(:secret => true, :category => category1) article1 = Article.create!(:secret => true, :category => category1)
article2 = Article.create!(:secret => true, :category => category2) article2 = Article.create!(:secret => true, :category => category2)
category1.articles.accessible_by(@ability).should == [article1] category1.articles.accessible_by(@ability).should == [article1]
end end
it "should raise an exception when trying to merge scope with other conditions" do it "should raise an exception when trying to merge scope with other conditions" do
@ability.can :read, Article, :published => true @ability.can :read, Article, :published => true