Sha256: 662c989139351438ef541d061d7cca3df9941bae9ee978c13c3763a925a06fcc

Contents?: true

Size: 792 Bytes

Versions: 4

Compression:

Stored size: 792 Bytes

Contents

require 'spec_helper'

root_dir = Rails3::Assist::Directory.rails_root

describe 'model helper' do
  use_orm :active_record  

  before :each do              
    create_model :account, :content => '# hello'
  end

  after :each do              
    remove_model :account
  end
    
  it "should have an :account model file that contains an Account class" do
    root_dir.should have_model_file :account do |file|
      file.should have_model_class :account
    end
    root_dir.should have_model :account
  end
end

describe 'model helper - no ORM helper' do
  use_helper :model

  before :each do              
    remove_model :account
  end
    
  it "should not be able to create a model without including an ORM helper" do
    lambda {create_model :account}.should raise_error
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails-app-spec-0.2.8 spec/rails_app_spec/matchers/artifact/model_spec.rb
rails-app-spec-0.2.7 spec/rails_app_spec/matchers/artifact/model_spec.rb
rails-app-spec-0.2.5 spec/rails_app_spec/matchers/artifact/model_spec.rb
rails-app-spec-0.2.4 spec/rails_app_spec/matchers/artifact/model_spec.rb