Sha256: 609a5e360228b17e96a711fe0e80cdec06d4c208f454953b1314745cc5108b7a

Contents?: true

Size: 777 Bytes

Versions: 28

Compression:

Stored size: 777 Bytes

Contents

require 'test_helper'

class AuthorTest < ActiveSupport::TestCase
  
  context "an author" do
    
    setup do
      setup_world()
      @author = Factory( :author )  # stock object for validation testing
    end

# validate multi-tenanting structure
    should have_db_column(:tenant_id)
    should_not allow_mass_assignment_of(:tenant_id)
    should "define the current tenant" do
      assert  Thread.current[:tenant_id]
    end
    should "match the current tenant" do
      assert_equal  @author.tenant_id, Thread.current[:tenant_id]
    end

# validate the model
    should belong_to( :user )
    should have_many( :posts )
    should have_many( :team_assets )
    should have_many( :teams ).through( :team_assets )
    
  end   # context author
  
end #   class author

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
milia-0.3.15 test/rails_app/test/unit/author_test.rb
milia-0.3.13 test/rails_app/test/unit/author_test.rb
milia-0.3.12 test/rails_app/test/unit/author_test.rb
milia-0.3.11 test/rails_app/test/unit/author_test.rb
milia-0.3.10 test/rails_app/test/unit/author_test.rb
milia-0.3.9 test/rails_app/test/unit/author_test.rb
milia-0.3.8 test/rails_app/test/unit/author_test.rb
milia-0.3.7 test/rails_app/test/unit/author_test.rb