This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe User do | |
pending "add some examples to (or delete) #{__FILE__}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe User do | |
before(:each) do | |
@attr = { :name => "Example User", :email => "[email protected]" } | |
end | |
it "should create a new instance given valid attributes" do | |
User.create!(@attr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe User do | |
before(:each) do | |
@attr = { :name => "Example User", :email => "[email protected]" } | |
end | |
. | |
. | |
. | |
it "should require a name" do | |
no_name_user = User.new(@attr.merge(:name => "")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe User do | |
before(:each) do | |
@attr = { :name => "Example User", :email => "[email protected]" } | |
end | |
it "should create a new instance given valid attributes" do | |
User.create!(@attr) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe User do | |
before(:each) do | |
@attr = { :name => "Example User", :email => "[email protected]" } | |
end | |
. | |
. | |
. | |
it "should require an email address" do | |
no_email_user = User.new(@attr.merge(:email => "")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe User do | |
before(:each) do | |
@attr = { :name => "Example User", :email => "[email protected]" } | |
end | |
it "should create a new instance given valid attributes" do | |
User.create!(@attr) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe User do | |
before(:each) do | |
@attr = { :name => "Example User", :email => "[email protected]" } | |
end | |
. | |
. | |
. | |
it "should reject names that are too long" do | |
long_name = "a" * 51 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe User do | |
before(:each) do | |
@attr = { :name => "Example User", :email => "[email protected]" } | |
end | |
it "should create a new instance given valid attributes" do | |
User.create!(@attr) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe User do | |
before(:each) do | |
@attr = { :name => "Example User", :email => "[email protected]" } | |
end | |
. | |
. | |
. | |
it "should accept valid email addresses" do | |
addresses = %w[[email protected] [email protected] [email protected]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe User do | |
before(:each) do | |
@attr = { :name => "Example User", :email => "[email protected]" } | |
end | |
it "should create a new instance given valid attributes" do | |
User.create!(@attr) | |
end |
OlderNewer