diff --git a/spec/factories.rb b/spec/factories.rb index fc76685d0..582c3e0a9 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -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 diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index 896794310..952f1cf1f 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -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) }