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 => "user@example.com" } | |
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 => "user@example.com" } | |
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 => "user@example.com" } | |
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 => "user@example.com" } | |
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 => "user@example.com" } | |
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 => "user@example.com" } | |
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 => "user@example.com" } | |
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 => "user@example.com" } | |
end | |
. | |
. | |
. | |
it "should accept valid email addresses" do | |
addresses = %w[user@foo.com THE_USER@foo.bar.org first.last@foo.jp] |
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 => "user@example.com" } | |
end | |
it "should create a new instance given valid attributes" do | |
User.create!(@attr) | |
end |
OlderNewer