Skip to content

Commit

Permalink
Status is :list
Browse files Browse the repository at this point in the history
  • Loading branch information
arafatm committed Apr 2, 2010
1 parent 44153e0 commit abbaa82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/status.rb
Expand Up @@ -8,6 +8,8 @@ class Status

include DataMapper::Resource

is :list

property :id, Serial
property :name, Text
property :position, Integer
Expand Down
12 changes: 12 additions & 0 deletions spec/status_spec.rb
Expand Up @@ -11,11 +11,23 @@
end

describe 'behaviour' do
before do
DataMapper.setup(:test, "sqlite3://test.db")
statuses = Status.all
statuses.destroy!
end

it 'should require a name' do
s = Status.new
s.save
s.errors.on(:name).should.include "Name must not be blank"
end

it 'should assign a default position' do
s = Status.new(:name => 'status 01')
s.save
s.position.should.not.be.nil
end
end

end

0 comments on commit abbaa82

Please sign in to comment.