Sha256: 759f4794a05259a5c0b12b30e13cd3ff65097f6895e630b11485ae06edf54750

Contents?: true

Size: 758 Bytes

Versions: 21

Compression:

Stored size: 758 Bytes

Contents

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

describe SurveyParser::Validation, " when first created" do
  before do    
    answer = mock("SurveyParser::Answer", :id => 2, :parser => mock("SurveyParser::Parser", :new_validation_id => 1))
    answer.stub!(:class => SurveyParser::Answer)
    args = [{:rule => "C", :message => "Please select a number between 0 and 120"}]
    options = {}
    @validation = SurveyParser::Validation.new(answer, args, options)
  end
  
  it "should set initialization parameters properly" do
    @validation.id.should == 1
    @validation.message.should == "Please select a number between 0 and 120"
    @validation.answer_id.should == 2
    @validation.rule.should == "C"
  end

end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
ccls-surveyor-1.0.0 script/surveyor/specs/validation_spec.rb
jakewendt-surveyor-0.11.3 script/surveyor/specs/validation_spec.rb
surveyor-0.14.5 script/surveyor/specs/validation_spec.rb
surveyor-0.14.4 script/surveyor/specs/validation_spec.rb
surveyor-0.14.3 script/surveyor/specs/validation_spec.rb
surveyor-0.14.2 script/surveyor/specs/validation_spec.rb
surveyor-0.14.1 script/surveyor/specs/validation_spec.rb
surveyor-0.14.0 script/surveyor/specs/validation_spec.rb
surveyor-0.13.0 script/surveyor/specs/validation_spec.rb
surveyor-0.12.1 script/surveyor/specs/validation_spec.rb
surveyor-0.11.0 script/surveyor/specs/validation_spec.rb
surveyor-0.10.0 script/surveyor/specs/validation_spec.rb
surveyor-0.9.10 script/surveyor/specs/validation_spec.rb
surveyor-0.9.9 script/surveyor/specs/validation_spec.rb
surveyor-0.9.8 script/surveyor/specs/validation_spec.rb
surveyor-0.9.7 script/surveyor/specs/validation_spec.rb
surveyor-0.9.6 script/surveyor/specs/validation_spec.rb
surveyor-0.9.5 script/surveyor/specs/validation_spec.rb
surveyor-0.9.4 script/surveyor/specs/validation_spec.rb
surveyor-0.9.3 script/surveyor/specs/validation_spec.rb