Sha256: bbb8710bb196a1f4d3c555a17ca3e51e070334730e9ca14ebbb64d5ae3295b79
Contents?: true
Size: 630 Bytes
Versions: 10
Compression:
Stored size: 630 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe State do before(:each) do @state = State.new end it "should not be valid when empty" do @state.should_not be_valid end ['country', 'name'].each do |field| it "should require #{field}" do @state.should_not be_valid @state.errors.full_messages.should include("#{field.humanize} #{I18n.translate("activerecord.errors.messages.blank")}") end end it "should be valid when having correct information" do @state.name = "A State" @state.abbr = "ST" @state.country = Country.new @state.should be_valid end end
Version data entries
10 entries across 10 versions & 2 rubygems