Permalink
Browse files

fix: TimeEntryActiviries are now Project-related

  • Loading branch information...
1 parent d2eda8b commit f4178bcf95cb13243c160d69c14834d9d9f6a9be Sven Krzyzak committed Nov 27, 2010
@@ -19,5 +19,16 @@ xml.project(:id => project.id, :newIssueAllowed => new_issue_allowed?(project),
xml.issueCustomFieldsByTracker({:trackerId => tracker.id}, integer_list(cf_list)) unless cf_list.empty?
end
end
+
+ xml.timeEntryActivities do
+ project.activities.each do |activity|
+ xml.timeEntryActivity :id => activity.id do
+ xml.name activity.name
+ xml.position activity.position
+ xml.isDefault activity.is_default
+ end
+ end
+ end
+
end
@@ -0,0 +1,100 @@
+---
+enumerations_001:
+ name: Uncategorized
+ id: 1
+ type: DocumentCategory
+ active: true
+enumerations_002:
+ name: User documentation
+ id: 2
+ type: DocumentCategory
+ active: true
+enumerations_003:
+ name: Technical documentation
+ id: 3
+ type: DocumentCategory
+ active: true
+enumerations_004:
+ name: Low
+ id: 4
+ type: IssuePriority
+ active: true
+ position: 1
+enumerations_005:
+ name: Normal
+ id: 5
+ type: IssuePriority
+ is_default: true
+ active: true
+ position: 2
+enumerations_006:
+ name: High
+ id: 6
+ type: IssuePriority
+ active: true
+ position: 3
+enumerations_007:
+ name: Urgent
+ id: 7
+ type: IssuePriority
+ active: true
+ position: 4
+enumerations_008:
+ name: Immediate
+ id: 8
+ type: IssuePriority
+ active: true
+ position: 5
+enumerations_009:
+ name: Design
+ id: 9
+ type: TimeEntryActivity
+ position: 1
+ active: true
+enumerations_010:
+ name: Development
+ id: 10
+ type: TimeEntryActivity
+ position: 2
+ is_default: true
+ active: true
+enumerations_011:
+ name: QA
+ id: 11
+ type: TimeEntryActivity
+ position: 3
+ active: true
+enumerations_012:
+ name: Default Enumeration
+ id: 12
+ type: Enumeration
+ is_default: true
+ active: true
+enumerations_013:
+ name: Another Enumeration
+ id: 13
+ type: Enumeration
+ active: true
+enumerations_014:
+ name: Inactive Activity
+ id: 14
+ type: TimeEntryActivity
+ position: 4
+ active: false
+enumerations_015:
+ name: Development
+ id: 15
+ type: TimeEntryActivity
+ position: 5
+ is_default: false
+ active: true
+ project_id: 1
+ parent_id: 10
+enumerations_016:
+ name: QA
+ id: 16
+ type: TimeEntryActivity
+ position: 3
+ active: false
+ project_id: 1
+ parent_id: 11
@@ -2,22 +2,7 @@
class MylynConnector::ProjectsControllerTest < MylynConnector::ControllerTest
- class << self
-
-# def fixtures(*table_names)
-# dir = File.join(File.dirname(__FILE__), "../../test/fixtures/" + self.rr)
-# Fixtures.create_fixtures(dir, "custom_fields")
-#
-# #TODO since 0.9 MemberRole exists
-# table_names.push(:member_roles) if Object.const_defined?(:MemberRole)
-#
-# super(table_names)
-# end
-
- end
-
- fixtures :users, :roles, :members, :member_roles, :issue_categories, :custom_fields, :trackers, :versions, :queries, :projects, :projects_trackers, :enabled_modules, :custom_fields_trackers
-
+ fixtures :users, :roles, :members, :member_roles, :issue_categories, :custom_fields, :trackers, :versions, :queries, :projects, :projects_trackers, :enabled_modules, :custom_fields_trackers, :enumerations
def setup
@@ -67,6 +52,18 @@ def test_all_unauthenticated
assert_tag :tag => 'issuecustomfieldsbytracker', :content => '6', :attributes => {:trackerid => 2}, :parent => {:tag => 'issuecustomfields', :children => {:count => 2}, :parent => p3}
assert_tag :tag => 'issuecustomfieldsbytracker', :content => '2 6', :attributes => {:trackerid => 3}, :parent => {:tag => 'issuecustomfields', :children => {:count => 2}, :parent => p3}
+ acts = {:tag => 'timeentryactivities', :children => {:count => 2}, :parent=>p1}
+ act = {:tag => 'timeentryactivity', :attributes => {:id => 15}, :parent => acts}
+ assert_tag :tag => 'name', :content => 'Development', :parent => act
+ assert_tag :tag => 'position', :content => '5', :parent => act
+ assert_tag :tag => 'isdefault', :content => 'false', :parent => act
+
+ acts = {:tag => 'timeentryactivities', :children => {:count => 3}, :parent=>p3}
+ act = {:tag => 'timeentryactivity', :attributes => {:id => 10}, :parent => acts}
+ assert_tag :tag => 'name', :content => 'Development', :parent => act
+ assert_tag :tag => 'position', :content => '2', :parent => act
+ assert_tag :tag => 'isdefault', :content => 'true', :parent => act
+
end
def test_all_authenticated
@@ -9,10 +9,11 @@
<xsd:element name="timeEntryActivities" xmlns="http://redmin-mylyncon.sf.net/api">
<xsd:complexType>
- <xsd:sequence >
- <xsd:element name="timeEntryActivity" type="tns:timeEntryActivity" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="api" type="tns:versionstring" use="required" />
+ <xsd:complexContent>
+ <xsd:extension base="tns:timeEntryActivities">
+ <xsd:attribute name="api" type="tns:versionstring" use="required" />
+ </xsd:extension>
+ </xsd:complexContent>
</xsd:complexType>
</xsd:element>
@@ -8,6 +8,7 @@
<xsd:include schemaLocation="property.xsd" />
<xsd:include schemaLocation="versionstring.xsd" />
<xsd:include schemaLocation="idList.xsd" />
+ <xsd:include schemaLocation="timeEntryActivity.xsd" />
<xsd:complexType name="project">
@@ -49,7 +50,8 @@
</xsd:complexType>
</xsd:element>
-
+ <xsd:element name="timeEntryActivities" type="tns:timeEntryActivities" />
+
</xsd:sequence>
<xsd:attribute name="newIssueAllowed" type="xsd:boolean" use="required"/>
<xsd:attribute name="moveIssueAllowed" type="xsd:boolean" use="required"/>
@@ -7,6 +7,12 @@
<xsd:include schemaLocation="property.xsd" />
+ <xsd:complexType name="timeEntryActivities">
+ <xsd:sequence >
+ <xsd:element name="timeEntryActivity" type="tns:timeEntryActivity" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+
<xsd:complexType name="timeEntryActivity">
<xsd:complexContent>
<xsd:extension base="tns:sortedProperty">

0 comments on commit f4178bc

Please sign in to comment.