Navigation Menu

Skip to content

Commit

Permalink
Add runners and default values for booleans on Task.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrichardlai committed Mar 17, 2012
1 parent ecadfa6 commit f9cd247
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/taskrabbit/task.rb
Expand Up @@ -4,14 +4,18 @@ class Task < Smash
property :name
property :user, :transformer => User
property :runner, :transformer => User
property :runners, :transformer => Api::collection_transformers[User]
property :named_price
property :charge_price
property :cost_in_cents
property :links
property :state_label
property :city_id
property :city, :transformer => City
property :description
property :virtual
property :description, :default => ''
property :private_description, :default => ''
property :private_runner, :default => false
property :virtual, :default => false
property :state
property :complete_by_time, :transformer => TIME_TRANSFORMER
property :state_changed_at, :transformer => TIME_TRANSFORMER
Expand Down
10 changes: 9 additions & 1 deletion spec/taskrabbit/task_spec.rb
Expand Up @@ -18,15 +18,23 @@
its(:name) { should == "2 Hours of House Cleaning + 1 Hour of House Chores" }
its(:user) { should be_instance_of(Taskrabbit::User) }
its(:runner) { should be_instance_of(Taskrabbit::User) }
its(:runners) { should be_a(Taskrabbit::Collection) }
its(:cost_in_cents) { should == 0 }
its(:description) { should }
its(:description) { should == '' }
its(:private_description) { should == '' }
its(:named_price) { should == nil }
its(:charge_price) { should == nil }
its(:cost_in_cents) { should == 0 }
its(:private_runner) { should == false }
its(:virtual) { should == false }
its(:state) { should == 'closed' }
its(:state_label) { should == 'closed' }
its(:location_visits) { should be_nil }
its(:city) { should be_instance_of(Taskrabbit::City) }
its(:assign_by_time) { should be_instance_of(Time) }
its(:complete_by_time) { should be_instance_of(Time) }
its(:state_changed_at) { should be_instance_of(Time) }
its(:links) { should be_instance_of(Hash) }
end

let(:valid_params) {
Expand Down

0 comments on commit f9cd247

Please sign in to comment.