You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB

13 years ago
shared_context "data" do
let(:user){create(:user)}
let(:ability){Ability.new(:user => user)}
let(:other_user){create(:user)}
let(:other_user_ability){Ability.new(:user => other_user)}
let(:third_user){create(:user)}
let(:third_user_ability){Ability.new(:user => third_user)}
13 years ago
let(:domain){
domain = build(:domain, :user => user)
13 years ago
domain.setup(FactoryGirl.generate(:email))
domain.save!
domain.soa_record.update_serial!
domain
}
let(:a_record){create(:a, :content => '127.0.0.1', :domain => domain)}
let(:soa_record){domain.soa_record}
# admin is a user that owns host domains
let(:admin){
admin_user = create(:user,
:first_name => 'admin',
:last_name => 'admin',
:email => 'admin@entrydns.net',
:confirmed_at => Time.now
)
admin_user.confirm!
admin_user
}
let(:admin_ability){Ability.new(:user => admin)}
let(:host_domain){
domain = build(:domain, :user => admin, :name => Settings.host_domains.first)
domain.setup(FactoryGirl.generate(:email))
domain.save!
domain.soa_record.update_serial!
domain
}
let(:host_a_record){create(:a, :content => '127.0.0.1', :domain => host_domain, :user => user)}
let(:permission){create(:permission, :domain => domain, :user => other_user)}
13 years ago
end