spec/models/refinery/user_spec.rb in refinerycms-authentication-devise-1.0.0 vs spec/models/refinery/user_spec.rb in refinerycms-authentication-devise-1.0.1
- old
+ new
@@ -11,11 +11,11 @@
}
context "Roles" do
context "add_role" do
it "raises Exception when Role object is passed" do
- expect {user.add_role(Refinery::Authentication::Devise::Role.new)}.to raise_exception
+ expect {user.add_role(Refinery::Authentication::Devise::Role.new)}.to raise_exception(::ArgumentError)
end
it "adds a Role to the User when role not yet assigned to User" do
expect(proc {
user.add_role(:new_role)
@@ -31,11 +31,11 @@
end
end
context "has_role" do
it "raises Exception when Role object is passed" do
- expect{ user.has_role?(Refinery::Authentication::Devise::Role.new)}.to raise_exception
+ expect{ user.has_role?(Refinery::Authentication::Devise::Role.new)}.to raise_exception(::ArgumentError)
end
it "returns the true if user has Role" do
expect(refinery_user.has_role?(:refinery)).to be_truthy
end
@@ -262,10 +262,10 @@
expect(first_user.roles.collect(&:title)).to include("Superuser")
end
it "adds registered plugins" do
expect(first_user.plugins.collect(&:name)).to eq(
- %w(refinery_authentication_devise refinery_images refinery_files refinery_pages)
+ %w(refinery_pages refinery_files refinery_images refinery_authentication_devise)
)
end
it "returns true on success" do
allow(first_user).to receive(:valid?).and_return(true)