Browse Source

fix domain tests

pull/1/head
Nicolae Claudius 10 years ago
parent
commit
8a94924219
  1. 1
      Gemfile
  2. 1
      Gemfile.lock
  3. 2
      app/models/domain/tree_structure.rb
  4. 2
      spec/models/domain_spec.rb

1
Gemfile

@ -73,6 +73,7 @@ group :test, :development do
gem 'rspec-rails', '~> 3.1.0' gem 'rspec-rails', '~> 3.1.0'
gem 'rspec-its', '~> 1.1.0' gem 'rspec-its', '~> 1.1.0'
gem 'rspec-collection_matchers', '~> 1.1.2' gem 'rspec-collection_matchers', '~> 1.1.2'
gem 'rspec-mocks', '~> 3.1.3'
end end
group :test do group :test do

1
Gemfile.lock

@ -365,6 +365,7 @@ DEPENDENCIES
rails_config (~> 0.4.2) rails_config (~> 0.4.2)
rspec-collection_matchers (~> 1.1.2) rspec-collection_matchers (~> 1.1.2)
rspec-its (~> 1.1.0) rspec-its (~> 1.1.0)
rspec-mocks (~> 3.1.3)
rspec-rails (~> 3.1.0) rspec-rails (~> 3.1.0)
sass-rails (~> 4.0.4) sass-rails (~> 4.0.4)
seedbank (~> 0.3.0) seedbank (~> 0.3.0)

2
app/models/domain/tree_structure.rb

@ -12,7 +12,7 @@ class Domain < ActiveRecord::Base
after_save :sync_children after_save :sync_children
# this goes after sync_parent, to order callbacks correctly # this goes after sync_parent, to order callbacks correctly
acts_as_nested_interval virtual_root: true, dependent: :nullify acts_as_nested_interval virtual_root: true, dependent: :restrict_with_error
validate :domain_ownership validate :domain_ownership
def domain_ownership def domain_ownership

2
spec/models/domain_spec.rb

@ -67,7 +67,7 @@ describe Domain do
User.do_as(user) do User.do_as(user) do
# stub a parent domain on another user account, with no permissions present # stub a parent domain on another user account, with no permissions present
mock_domain = mock( mock_domain = double(
:user_id => user3.id, :user_id => user3.id,
:user => user3, :user => user3,
:name => 'x', :name => 'x',

Loading…
Cancel
Save