adds organization factory and refactors ability_spec
This commit is contained in:
@@ -8,6 +8,13 @@ FactoryGirl.define do
|
||||
confirmed_at { Time.now }
|
||||
end
|
||||
|
||||
factory :organization, class: User do
|
||||
organization_name 'org'
|
||||
sequence(:email) { |n| "org#{n}@madrid.es" }
|
||||
password 'pleaseverifyme'
|
||||
confirmed_at { Time.now }
|
||||
end
|
||||
|
||||
factory :debate do
|
||||
sequence(:title) {|n| "Debate #{n} title"}
|
||||
description 'Debate description'
|
||||
@@ -39,4 +46,6 @@ FactoryGirl.define do
|
||||
user
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -46,7 +46,7 @@ describe Ability do
|
||||
end
|
||||
|
||||
describe "Organization" do
|
||||
let(:user) { create(:user, organization_name: "Organization") }
|
||||
let(:user) { create(:organization) }
|
||||
|
||||
it { should be_able_to(:show, user) }
|
||||
it { should be_able_to(:edit, user) }
|
||||
|
||||
Reference in New Issue
Block a user