pivotal-tracker 0.1.0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0.1
1
+ 0.1.1
@@ -14,19 +14,21 @@ module PivotalTracker
14
14
  attr_accessor :project_id
15
15
 
16
16
  element :id, Integer
17
+ element :url, String
18
+ element :created_at, DateTime
19
+ element :accepted_at, DateTime
20
+
21
+ element :name, String
22
+ element :description, String
17
23
  element :story_type, String
18
- element :url, String
19
24
  element :estimate, Integer
20
25
  element :current_state, String
21
- element :name, String
22
26
  element :requested_by, String
23
27
  element :owned_by, String
24
- element :created_at, DateTime
25
- element :accepted_at, DateTime
26
28
  element :labels, String
27
- element :description, String
28
29
  element :jira_id, Integer
29
30
  element :jira_url, String
31
+ element :other_id, Integer
30
32
 
31
33
  def initialize(attributes={})
32
34
  self.project_id = attributes.delete(:owner).id if attributes[:owner]
@@ -64,15 +66,17 @@ module PivotalTracker
64
66
  builder = Nokogiri::XML::Builder.new do |xml|
65
67
  xml.story {
66
68
  xml.name "#{name}"
69
+ xml.description "#{description}"
67
70
  xml.story_type "#{story_type}"
68
71
  xml.estimate "#{estimate}"
69
72
  xml.current_state "#{current_state}"
70
73
  xml.requested_by "#{requested_by}"
71
74
  xml.owned_by "#{owned_by}"
72
75
  xml.labels "#{labels}"
73
- xml.description "#{description}"
76
+ # See spec
74
77
  # xml.jira_id "#{jira_id}"
75
78
  # xml.jira_url "#{jira_url}"
79
+ xml.other_id "#{other_id}"
76
80
  }
77
81
  end
78
82
  return builder.to_xml
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pivotal-tracker}
8
- s.version = "0.1.0.1"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Smestad", "Josh Nichols", "Terence Lee"]
12
- s.date = %q{2010-04-05}
12
+ s.date = %q{2010-04-22}
13
13
  s.email = %q{justin.smestad@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
@@ -1,3 +1,4 @@
1
+ require 'rubygems'
1
2
  require 'bundler'
2
3
  require 'stale_fish'
3
4
 
@@ -23,5 +23,83 @@ describe PivotalTracker::Story do
23
23
  @project.stories.create(:name => 'Create Stuff').should be_a(PivotalTracker::Story)
24
24
  end
25
25
  end
26
+
27
+ context ".new" do
28
+
29
+ def story_for(attrs)
30
+ story = @project.stories.new(attrs)
31
+ @story = Hash.from_xml(story.send(:to_xml))['story']
32
+ end
33
+
34
+ describe "attributes that are not sent to the tracker" do
35
+
36
+ it "should include id" do
37
+ story_for(:id => 10)["id"].should be_nil
38
+ end
39
+
40
+ it "should include url" do
41
+ story_for(:url => "somewhere")["url"].should be_nil
42
+ end
43
+
44
+ it "should include created_at" do
45
+ story_for(:created_at => Time.now)["created_at"].should be_nil
46
+ end
47
+
48
+ it "should include accepted_at" do
49
+ story_for(:accepted_at => Time.now)["accepted_at"].should be_nil
50
+ end
51
+
52
+ end
53
+
54
+ describe "attributes that are sent to the tracker" do
55
+
56
+ it "should include name" do
57
+ story_for(:name => "A user should...")["name"].should == "A user should..."
58
+ end
59
+
60
+ it "should include description" do
61
+ story_for(:description => "desc...")["description"].should == "desc..."
62
+ end
63
+
64
+ it "should include story_type" do
65
+ story_for(:story_type => "feature")["story_type"].should == "feature"
66
+ end
67
+
68
+ it "should include estimate" do
69
+ story_for(:estimate => 5)["estimate"].should == "5"
70
+ end
71
+
72
+ it "should include current_state" do
73
+ story_for(:current_state => "accepted")["current_state"].should == "accepted"
74
+ end
75
+
76
+ it "should include requested_by" do
77
+ story_for(:requested_by => "Joe Doe")["requested_by"].should == "Joe Doe"
78
+ end
79
+
80
+ it "should include owned_by" do
81
+ story_for(:owned_by => "Joe Doe")["owned_by"].should == "Joe Doe"
82
+ end
83
+
84
+ it "should include labels" do
85
+ story_for(:labels => "abc")["labels"].should == "abc"
86
+ end
87
+
88
+ it "should include other_id" do
89
+ story_for(:other_id => 10)["other_id"].should == "10"
90
+ end
91
+
92
+ # the tracker returns 422 when this is included, even if it is not used
93
+ # it "should include jira_id" do
94
+ # story_for(:jira_id => 10)["jira_id"].should == "10"
95
+ # end
96
+ #
97
+ # it "should include jira_url" do
98
+ # story_for(:jira_url => "somewhere")["jira_url"].should == "somewhere"
99
+ # end
100
+
101
+ end
102
+
103
+ end
26
104
 
27
105
  end
metadata CHANGED
@@ -5,9 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
8
  - 1
10
- version: 0.1.0.1
9
+ version: 0.1.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - Justin Smestad
@@ -17,13 +16,13 @@ autorequire:
17
16
  bindir: bin
18
17
  cert_chain: []
19
18
 
20
- date: 2010-04-05 00:00:00 -06:00
19
+ date: 2010-04-22 00:00:00 -06:00
21
20
  default_executable:
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
23
+ type: :runtime
24
24
  name: rest-client
25
- prerelease: false
26
- requirement: &id001 !ruby/object:Gem::Requirement
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
27
26
  requirements:
28
27
  - - ~>
29
28
  - !ruby/object:Gem::Version
@@ -32,12 +31,12 @@ dependencies:
32
31
  - 4
33
32
  - 1
34
33
  version: 1.4.1
35
- type: :runtime
36
- version_requirements: *id001
34
+ requirement: *id001
35
+ prerelease: false
37
36
  - !ruby/object:Gem::Dependency
37
+ type: :runtime
38
38
  name: happymapper
39
- prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
39
+ version_requirements: &id002 !ruby/object:Gem::Requirement
41
40
  requirements:
42
41
  - - ">="
43
42
  - !ruby/object:Gem::Version
@@ -46,24 +45,24 @@ dependencies:
46
45
  - 2
47
46
  - 4
48
47
  version: 0.2.4
49
- type: :runtime
50
- version_requirements: *id002
48
+ requirement: *id002
49
+ prerelease: false
51
50
  - !ruby/object:Gem::Dependency
51
+ type: :runtime
52
52
  name: builder
53
- prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
53
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
54
  requirements:
56
55
  - - ">="
57
56
  - !ruby/object:Gem::Version
58
57
  segments:
59
58
  - 0
60
59
  version: "0"
61
- type: :runtime
62
- version_requirements: *id003
60
+ requirement: *id003
61
+ prerelease: false
63
62
  - !ruby/object:Gem::Dependency
63
+ type: :runtime
64
64
  name: nokogiri
65
- prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
65
+ version_requirements: &id004 !ruby/object:Gem::Requirement
67
66
  requirements:
68
67
  - - ~>
69
68
  - !ruby/object:Gem::Version
@@ -72,8 +71,8 @@ dependencies:
72
71
  - 4
73
72
  - 1
74
73
  version: 1.4.1
75
- type: :runtime
76
- version_requirements: *id004
74
+ requirement: *id004
75
+ prerelease: false
77
76
  description:
78
77
  email: justin.smestad@gmail.com
79
78
  executables: []