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.
Merge branch 'master' of git@github.com:railsrumble/teamwnn
- Loading branch information
Showing
20 changed files
with
187 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,5 @@ class Link < ActiveRecord::Base | |
|
||
belongs_to :project | ||
|
||
def to_s | ||
name | ||
end | ||
validates_presence_of :name, :url | ||
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 |
---|---|---|
|
@@ -3,7 +3,5 @@ class Note < ActiveRecord::Base | |
|
||
belongs_to :project | ||
|
||
def to_s | ||
name | ||
end | ||
validates_presence_of :name, :content | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,66 @@ | ||
Factory.sequence :email do |n| | ||
"foo#{n}@example.com" | ||
end | ||
|
||
Factory.sequence :username do |n| | ||
"foobar#{n}" | ||
end | ||
|
||
Factory.define :user do |f| | ||
f.username 'foobar' | ||
f.email 'foo@example.com' | ||
f.username { Factory.next(:username) } | ||
f.email { Factory.next(:email) } | ||
f.password 'secret' | ||
f.password_confirmation 'secret' | ||
end | ||
|
||
Factory.define :project do |f| | ||
f.user { |c| c.association(:user) } | ||
f.name 'Foo Bar' | ||
f.description 'Lorem' | ||
f.last_activity_at Time.now | ||
end | ||
|
||
Factory.define :code_snippet do |f| | ||
f.project { |c| c.association(:project) } | ||
f.name 'Hello, World' | ||
f.content 'puts "Hello, World"' | ||
f.language 'Ruby' | ||
end | ||
|
||
Factory.define :palette do |f| | ||
f.project { |c| c.association(:project) } | ||
f.name 'Color Theme' | ||
end | ||
|
||
Factory.define :color_swatch do |f| | ||
f.palette { |c| c.association(:palette) } | ||
f.hex '#FFF' | ||
end | ||
|
||
Factory.define :link do |f| | ||
f.project { |c| c.association(:project) } | ||
f.name 'Railscasts' | ||
f.url 'http://railscasts.com' | ||
f.description 'Free Ruby on Rails Screencasts' | ||
end | ||
|
||
Factory.define :note do |f| | ||
f.project { |c| c.association(:project) } | ||
f.name 'Foo' | ||
f.content 'This is a note' | ||
end | ||
|
||
Factory.define :photo do |f| | ||
f.project { |c| c.association(:project) } | ||
f.name 'Me!' | ||
f.image_file_name 'me.jpg' | ||
f.image_content_type 'image/jpeg' | ||
f.image_file_size '986123' | ||
f.image_updated_at Time.now | ||
end | ||
|
||
Factory.define :screenshot do |f| | ||
f.project { |c| c.association(:project) } | ||
f.name 'Railscasts Home' | ||
f.source_url 'http://railscasts.com' | ||
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,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
Oops, something went wrong.