Sha256: c7cf8e972bacfaa7fe2bde24e9d146e270617d676f4ceb8c762ff07a077509a8

Contents?: true

Size: 1.52 KB

Versions: 17

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  
    Rails3::Assist::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

17 entries across 17 versions & 1 rubygems

Version Path
rails3_artifactor-0.4.0 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.3.2 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.3.1 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.3.0 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.2.8 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.2.7 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.2.6 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.2.5 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.2.4 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.2.3 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.2.2 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.2.1 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.1.5 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.1.4 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.1.3 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.1.2 spec/rails3_artifactor/base/crud/read_spec.rb
rails3_artifactor-0.1.1 spec/rails3_artifactor/base/crud/read_spec.rb