Sha256: 23e585397f005e34eed542d5c72c31a58f804b680f93bf9953df70640df51724

Contents?: true

Size: 1.52 KB

Versions: 7

Compression:

Stored size: 1.52 KB

Contents

require 'spec_helper'

CONTENT = %q{
  # Hello
  # Intro
  # Goodbye
}

describe 'model without orm' do
  use_orm :none
  use_helper :model

  before :each do  
    RailsAssist::Directory.rails_root = fixtures_dir
  end

  after :each do              
    # remove_model :account
  end

  describe '#read_artifact' do
    before :each do  
      create_artifact :person, :type => :model do
        CONTENT
      end      
    end    

    after :each do              
      remove_model :person
    end
    
    it "should read artifact" do
      content = read_artifact :person, :type => :model
      content.should have_comment 'Hello'
    end
  end

  describe '#read_artifact :before' do
    before :each do  
      create_artifact :person, :type => :model do
        CONTENT
      end      
    end    

    after :each do              
      remove_model :person
    end

    it "should read before 'Hello'" do
      content = read_artifact :person, :type => :model, :before => 'Intro'
      content.should have_comment 'Hello'
      content.should_not have_comment 'Goodbye'
    end    
  end

  describe '#read_artifact :after' do
    before :each do  
      create_artifact :person, :type => :model do
        CONTENT
      end      
    end    

    after :each do              
      remove_model :person
    end

    it "should read after 'Hello' " do
      content = read_artifact :person, :type => :model, :after => 'Intro'
      content.should have_comment 'Goodbye'
      content.should_not have_comment 'Hello'
    end    
  end


end





Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_artifactor-0.5.1 spec/rails_artifactor/base/crud/read_spec.rb
rails_artifactor-0.5.0 spec/rails_artifactor/base/crud/read_spec.rb
rails_artifactor-0.4.0 spec/rails_artifactor/base/crud/read_spec.rb
rails_artifactor-0.3.6 spec/rails_artifactor/base/crud/read_spec.rb
rails_artifactor-0.3.5 spec/rails_artifactor/base/crud/read_spec.rb
rails_artifactor-0.3.4 spec/rails_artifactor/base/crud/read_spec.rb
rails_artifactor-0.3.3 spec/rails_artifactor/base/crud/read_spec.rb