Sha256: e7b31b1dac1208c27efd2b0b061db886d78c8d4667c19b8285d0762f7637885b

Contents?: true

Size: 872 Bytes

Versions: 2

Compression:

Stored size: 872 Bytes

Contents

require 'spec_helper'

root_dir = RailsAssist::Directory.rails_root

describe 'model helper' do
  use_orm :mongoid  
  
  before :each do
    create_model :account do
      %q{
        # hello
        def do_it
        end
      }
    end

    create_model :person, :content => '# hello'
  end

  after :each do              
    remove_models :account, :person
  end
    
  it "should have an :account model file that contains an Account class" do 
    puts read_model :account 
    root_dir.should have_model_file :account do |file|
      file.should have_model_class :account
      file.should have_comment 'hello'
      file.should have_method :do_it
    end
    root_dir.should have_model :account do |clazz|
      puts clazz
      clazz.should have_comment 'hello'
      clazz.should have_method :do_it
    end
    root_dir.should_not have_model :user    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails-app-spec-0.4.0 spec/rails_app_spec/matchers/artifact/model_mongoid_spec.rb
rails-app-spec-0.3.3 spec/rails_app_spec/matchers/artifact/model_mongoid_spec.rb