This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding basic validations of name presence
- Loading branch information
Showing
17 changed files
with
132 additions
and
22 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
class ColorSwatch < ActiveRecord::Base | ||
belongs_to :palette | ||
|
||
validates_presence_of :hex | ||
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe CodeSnippet do | ||
it "should be valid" do | ||
CodeSnippet.new.should be_valid | ||
it "should be valid from factory" do | ||
Factory.build(:code_snippet).should be_valid | ||
end | ||
|
||
it "should require name" do | ||
Factory.build(:code_snippet, :name => '').should have(1).error_on(:name) | ||
end | ||
|
||
it "should require content" do | ||
Factory.build(:code_snippet, :content => '').should have(1).error_on(:content) | ||
end | ||
|
||
it "should require language" do | ||
Factory.build(:code_snippet, :language => '').should have(1).error_on(:language) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe ColorSwatch do | ||
it "should be valid" do | ||
ColorSwatch.new.should be_valid | ||
it "should be valid from factory" do | ||
Factory.build(:color_swatch).should be_valid | ||
end | ||
|
||
it "should require hex" do | ||
Factory.build(:color_swatch, :hex => '').should have(1).error_on(:hex) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe Link do | ||
it "should be valid" do | ||
Link.new.should be_valid | ||
it "should be valid from factory" do | ||
Factory.build(:link).should be_valid | ||
end | ||
|
||
it "should require name" do | ||
Factory.build(:link, :name => '').should have(1).error_on(:name) | ||
end | ||
|
||
it "should require url" do | ||
Factory.build(:link, :url => '').should have(1).error_on(:url) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe Note do | ||
it "should be valid" do | ||
Note.new.should be_valid | ||
it "should be valid from factory" do | ||
Factory.build(:note).should be_valid | ||
end | ||
|
||
it "should require name" do | ||
Factory.build(:note, :name => '').should have(1).error_on(:name) | ||
end | ||
|
||
it "should require content" do | ||
Factory.build(:note, :content => '').should have(1).error_on(:content) | ||
end | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe Photo do | ||
it "should be valid" do | ||
Photo.new.should be_valid | ||
it "should be valid from factory" do | ||
Factory.build(:photo).should be_valid | ||
end | ||
|
||
it "should require name" do | ||
Factory.build(:photo, :name => '').should have(1).error_on(:name) | ||
end | ||
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
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