end of day commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
FactoryGirl.define do
|
||||
factory :section do
|
||||
association :supplier
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,42 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe :section do
|
||||
before :each do
|
||||
@section = build :section
|
||||
end
|
||||
|
||||
describe :path do
|
||||
describe :width do
|
||||
it "should have zero width when initialized" do
|
||||
Section.new.width.should be_zero
|
||||
end
|
||||
it "should have new width when it is defined using a setter" do
|
||||
@section.width = 3.2
|
||||
@section.width.should == 3.2
|
||||
end
|
||||
it "should persist width property through database" do
|
||||
@section.width = 3.2
|
||||
@section.save
|
||||
@reloaded_section = Section.find(@section.id)
|
||||
@reloaded_section.width.should == 3.2
|
||||
end
|
||||
end
|
||||
describe :height do
|
||||
it "should have zero height when initialized" do
|
||||
Section.new.height.should be_zero
|
||||
end
|
||||
it "should have new height when it is defined using a setter" do
|
||||
@section.height = 3.2
|
||||
@section.height.should == 3.2
|
||||
end
|
||||
it "should persist height property through database" do
|
||||
@section.height = 3.2
|
||||
@section.save
|
||||
@reloaded_section = Section.find(@section.id)
|
||||
@reloaded_section.height.should == 3.2
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user