Sha256: 90e7ca629c455959479af5637dca0feddbab8677971fdad02e1903ad89d33a06
Contents?: true
Size: 899 Bytes
Versions: 18
Compression:
Stored size: 899 Bytes
Contents
require File.expand_path("../../spec_helper", __FILE__) describe "Changing an attribute" do describe "before a record is saved" do before do @user = User.new @user.name = "James" end it "responds to the attribute being changed" do @user.should be_name_changed end it "returns the original value of the attribute" do @user.name_was.should == "" end it "is changed" do @user.should be_changed end end describe "after saving a record with changed attributes" do before do @user = User.create @user.name = "James" @user.save end it "is no longer attribute_changed?" do @user.should_not be_name_changed end it "returns nil for attribute_was" do @user.name_was.should be_nil end it "is no longer changed" do @user.should_not be_changed end end end
Version data entries
18 entries across 18 versions & 7 rubygems