Sha256: 5d7ff888272e18e82afdcc48a72c722a108014f66a32f7ad3bf8fc11f8fe5044

Contents?: true

Size: 1.07 KB

Versions: 8

Compression:

Stored size: 1.07 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe RePipelineHelper do 
  
  before(:each) do
    @re_pipeline = mock("RePipeline")
  end
  
  it "should be 'draft' when changed status is CHANGED_STATUS_DRAFT" do
    @re_pipeline.should_receive(:changed_status).and_return(RePipelineBase::CHANGED_STATUS_DRAFT)
    helper.re_pipeline_status(@re_pipeline).should == 'draft'
  end

  it "should be 'changed' when changed status is CHANGED_STATUS_CHANGED" do
    @re_pipeline.should_receive(:changed_status).and_return(RePipelineBase::CHANGED_STATUS_CHANGED)
    helper.re_pipeline_status(@re_pipeline).should == 'changed'
  end

  it "should be 'current' when changed status is CHANGED_STATUS_CURRENT" do
    @re_pipeline.should_receive(:changed_status).and_return(RePipelineBase::CHANGED_STATUS_CURRENT)
    helper.re_pipeline_status(@re_pipeline).should == 'current'
  end

  it "should be 'current' when changed status is unknown" do
    @re_pipeline.should_receive(:changed_status).and_return(20202020202)
    helper.re_pipeline_status(@re_pipeline).should == 'current'
  end
      
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rules_engine-0.1.1 rails_generators/templates/spec/helpers/re_pipeline_helper_spec.rb
rules_engine-0.1.0 rails_generators/templates/spec/helpers/re_pipeline_helper_spec.rb
rules_engine-0.0.8 rails_generators/templates/spec/helpers/re_pipeline_helper_spec.rb
rules_engine-0.0.7 rails_generators/templates/spec/helpers/re_pipeline_helper_spec.rb
rules_engine-0.0.6 rails_generators/templates/spec/helpers/re_pipeline_helper_spec.rb
rules_engine-0.0.5 rails_generators/templates/spec/helpers/re_pipeline_helper_spec.rb
rules_engine-0.0.4 rails_generators/templates/spec/helpers/re_pipeline_helper_spec.rb
rules_engine-0.0.3 rails_generators/templates/spec/helpers/re_pipeline_helper_spec.rb