Sha256: 8dc606b787d371762341e372587a4afb174157f2ce58bb7f5529196219d84f7b

Contents?: true

Size: 900 Bytes

Versions: 3

Compression:

Stored size: 900 Bytes

Contents

require 'spec_helper'

describe 'model with active_record' do
  use_orm :active_record

  before do
    Rails3::Assist::Directory.rails_root = File.dirname (__FILE__)
  end

  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

3 entries across 3 versions & 1 rubygems

Version Path
rails3_artifactor-0.4.0 spec/rails3_artifactor/artifact/orm/active_record_spec.rb
rails3_artifactor-0.3.2 spec/rails3_artifactor/artifact/orm/active_record_spec.rb
rails3_artifactor-0.3.1 spec/rails3_artifactor/artifact/orm/active_record_spec.rb