Sha256: f746fa5273d2e654422f63097cee58e1591cbdce170eabcd506b46f642fc0935
Contents?: true
Size: 702 Bytes
Versions: 14
Compression:
Stored size: 702 Bytes
Contents
require 'spec_helper' associations = { :has_and_belongs_to_many => %w(events) } describe Link do subject{ Link } let(:link){ Link.new } spec_associations(associations, :class => Link) describe "a valid Link" do before(:all) do link.valid? end it "has a name" do link.should have(1).error_on(:name) end it "has a url" do link.errors[:url].should include('can\'t be blank') end it "has a /valid/ url but will prepend 'http://' by default if no protocol is detected and url is not blank" do link.name = 'Test' link.url = 'test.com' link.valid?.should be_true link.url.should eq 'http://test.com' end end end
Version data entries
14 entries across 14 versions & 1 rubygems