Last active
December 11, 2015 03:09
-
-
Save amite/4535863 to your computer and use it in GitHub Desktop.
Project Spec Rspec test
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 Project do | |
context "while starting up" do | |
before do | |
options = { | |
name: 'Building house', | |
priority: 2, | |
tasks: [] | |
} | |
@project = Project.new(options) | |
end | |
it "has a name" do | |
expect(@project.name).to include('Building house') | |
end | |
it "has zero tasks" do | |
@project.tasks.should be_empty | |
end | |
end | |
context "manipulating projects" do | |
before do | |
options1 = { | |
name: 'Building house', | |
priority: 2, | |
tasks: [] | |
} | |
options2 = { | |
name: 'Getting a loan from the Bank', | |
priority: 3, | |
tasks: [] | |
} | |
@project1 = Project.new(options1) | |
@project2 = Project.new(options2) | |
end | |
it "has to return more than 0 projects" do | |
Project.count.should be > 0 | |
end | |
it "can print all projects" do | |
Project.all.should eq([@project1, @project2]) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment