spec/lib/redpomo/tracker_spec.rb in redpomo-0.0.5 vs spec/lib/redpomo/tracker_spec.rb in redpomo-0.0.6

- old
+ new

@@ -5,12 +5,12 @@ subject do Redpomo::Tracker.new( "welaika", url: "http://code.welaika.com", - token: "WELAIKA_TOKEN", - closed_status: "5" + token: "WELAIKA_TOKEN",#"WELAIKA_TOKEN", + closed_status_id: "5" ) end describe ".close_issue!" do it "closes the issue with the specified message" do @@ -26,12 +26,46 @@ it "creates an Issue for each remote issue" do VCR.use_cassette('issues') do issues = subject.issues issues.should have(7).issues issues.first.tracker.should == subject - issues.first.project.should == 'dashboard-fiat' + issues.first.project_id.should == 'dashboard-fiat' issues.first.issue_id.should == 3316 issues.first.due_date.should be_nil + end + end + end + + describe ".push_entry!" do + it "creates a TimeEntry" do + VCR.use_cassette('push_entry') do + task = stub( + issue: 3392, + text: "Foobar" + ) + entry = stub( + to_task: task, + datetime: Date.new(2012, 1, 1), + duration: 5 + ) + result = subject.push_entry!(entry) + result["time_entry"]["issue"]["id"].should == 3392 + end + end + end + + describe ".create_issue!" do + it "creates an Issue" do + VCR.use_cassette('create_issue') do + issue = stub( + subject: "foo", + description: "bar", + due_date: Date.new(2012, 12, 1), + project_id: "olasagasti", + priority_id: 5 + ) + result = subject.create_issue!(issue) + result["issue"]["id"].should be_present end end end end