Sha256: d3759c08477c4407d5edb41f18889fa727b7816629da155a99a5422d0794b8c4

Contents?: true

Size: 1.6 KB

Versions: 18

Compression:

Stored size: 1.6 KB

Contents

require 'spec_helper'

describe 'model with Mongo Mapper' do
  use_orm :mongo_mapper

  before :each do              
    remove_model :account        
    create_model :account do
      %q{  def index
  end}
    end    
  end

  after :each do              
    # remove_model :account
  end
    
  it "should have an account_model file that contains an index method and two inserted comments" do
    insert_into_model :account, :content => '# hello'
    insert_into_model :account do
      '# goodbye'
    end              
    puts read_model(:account)    
    read_model(:account).should have_comment 'hello'

    # root_dir.should have_model :account do |model_file|
    #   model_file.should have_method :index
    #   model_file.should have_comment 'hello'
    #   model_file.should have_comment 'goodbye'
    # end
  end
end

describe 'model with Data Mapper' do
  use_orm :data_mapper

  before :each do              
    remove_model :account        
    create_model :account do
      %q{  def index
  end}
    end    
  end

  after :each do              
    # remove_model :account
  end
    
  it "should have an account_model file that contains an index method and two inserted comments" do
    insert_into_model :account, :content => '# hello'
    insert_into_model :account do
      '# goodbye'
    end     
    puts read_model(:account)        
    read_model(:account).should have_comment 'hello'

    # root_dir.should have_model :account do |model_file|
    #   model_file.should have_method :index
    #   model_file.should have_comment 'hello'
    #   model_file.should have_comment 'goodbye'
    # end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
rails3_artifactor-0.3.0 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.2.8 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.2.7 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.2.6 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.2.5 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.2.4 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.2.3 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.2.2 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.2.1 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.1.5 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.1.4 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.1.3 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_assist-0.2.4 spec/rails3_assist/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.1.2 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.1.1 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_assist-0.2.3 spec/rails3_assist/artifact/orm/mongo_mapper_spec.rb
rails3_artifactor-0.1.0 spec/rails3_artifactor/artifact/orm/mongo_mapper_spec.rb
rails3_assist-0.2.2 spec/rails3_assist/artifact/orm/mongo_mapper_spec.rb