Sha256: 4084ad72650cdfe83d77d924cdb6a57e3201237b8b04de2072d0f24b9b5725f7

Contents?: true

Size: 712 Bytes

Versions: 2

Compression:

Stored size: 712 Bytes

Contents

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

RSpec::Matchers.define :have_valid_kid_keys do |expected|
  match do |actual|
    actual.kid_date.to_s.should =~ /\d{1,5}/
    actual.kid_time.to_s.should =~ /\d{1,5}/
    actual.kid_user.should =~ /\w{1,4}/
    actual.kid_mult.to_s.should =~ /\d{1,3}/
    actual.kid_comm.to_s.should =~ /\d{1,3}/
  end
end

describe CityPair do

    it "sets kid values for new city_pair" do
      city_pair = CityPair.new
      city_pair.should have_valid_kid_keys
    end

    it "sets kid vlues for CityCost" do
      city_pair = CityPair.new
      city_cost = CityCost.new(:city_pair=>city_pair)
      city_cost.should have_valid_kid_keys
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fossil-0.5.40 spec/models/city_pair_spec.rb
fossil-0.5.39 spec/models/city_pair_spec.rb