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
surveyor-0.9.2 script/surveyor/specs/validation_spec.rb