turingstudio-basecamp-rb 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. data/Rakefile +21 -0
  2. data/lib/basecamp/attachment.rb +23 -23
  3. data/lib/basecamp/attachment_category.rb +10 -0
  4. data/lib/basecamp/base.rb +5 -109
  5. data/lib/basecamp/company.rb +10 -0
  6. data/lib/basecamp/message.rb +24 -22
  7. data/lib/basecamp/milestone.rb +50 -0
  8. data/lib/basecamp/person.rb +18 -0
  9. data/lib/basecamp/post_category.rb +10 -0
  10. data/lib/basecamp/project.rb +22 -0
  11. data/lib/basecamp/record.rb +42 -13
  12. data/lib/basecamp/resource.rb +9 -9
  13. data/lib/basecamp/time_entry.rb +11 -9
  14. data/lib/basecamp/todoitem.rb +6 -6
  15. data/lib/basecamp/todolist.rb +16 -14
  16. data/lib/basecamp/version.rb +1 -1
  17. data/lib/basecamp.rb +7 -1
  18. data/spec/lib/basecamp/attachment_category_spec.rb +12 -0
  19. data/spec/lib/basecamp/attachment_spec.rb +26 -0
  20. data/spec/lib/basecamp/base_spec.rb +44 -0
  21. data/spec/lib/basecamp/company_spec.rb +13 -0
  22. data/spec/lib/basecamp/message_spec.rb +45 -0
  23. data/spec/lib/basecamp/milestone_spec.rb +44 -0
  24. data/spec/lib/basecamp/person_spec.rb +18 -0
  25. data/spec/lib/basecamp/post_category_spec.rb +13 -0
  26. data/spec/lib/basecamp/project_spec.rb +12 -0
  27. data/spec/lib/basecamp/record_spec.rb +57 -0
  28. data/spec/lib/basecamp/time_entry_spec.rb +23 -0
  29. data/spec/lib/basecamp/todo_item_spec.rb +38 -0
  30. data/spec/lib/basecamp/todo_list_spec.rb +36 -0
  31. data/spec/spec_helper.rb +68 -1
  32. metadata +44 -18
  33. data/spec/basecamp_spec.rb +0 -61
  34. data/spec/lib/basecamp_base.rb +0 -75
  35. data/spec/lib/basecamp_message_spec.rb +0 -42
  36. data/spec/lib/basecamp_todo_item_spec.rb +0 -40
  37. data/spec/lib/basecamp_todo_list_spec.rb +0 -32
@@ -1,75 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
2
- require File.dirname(__FILE__) + '/../../lib/basecamp.rb'
3
-
4
- describe Basecamp::Base do
5
-
6
- before(:each) do
7
- Basecamp::Base.establish_connection!('flatsoft-test.grouphub.com', 'flatsoft', '123456')
8
- @basecamp = Basecamp::Base.new
9
- end
10
-
11
- it "should return the list of all accessible projects" do
12
- @basecamp.projects.should_not be_blank
13
- @basecamp.projects.should be_kind_of(Array)
14
- end
15
-
16
- it "should return valid project with name" do
17
- @basecamp.projects.first.name.should_not be_empty
18
- end
19
-
20
- it "should find person" do
21
- person = @basecamp.person(2926255)
22
- person.should_not be_blank
23
- end
24
-
25
- it "should return the list of message categories for the given project" do
26
- categories = @basecamp.message_categories(2388627)
27
- categories.should_not be_blank
28
- categories.should be_kind_of(Array)
29
- end
30
-
31
- # CONTACT MANAGEMENT
32
-
33
- it "should return information for the company with the given id" do
34
- company = @basecamp.company(1098114)
35
- company.should_not be_blank
36
- end
37
-
38
- it "should return an array of the people in the given company" do
39
- people = @basecamp.people(1098114)
40
- people.should_not be_blank
41
- people.should be_kind_of(Array)
42
- end
43
-
44
- it "should return information about the person with the given id" do
45
- @basecamp.person(2926255).should_not be_nil
46
- end
47
-
48
- # MILESTONES
49
-
50
- it "should return a list of all milestones for the given project" do
51
- milestones = @basecamp.milestones(2388627)
52
- milestones.should be_kind_of(Array)
53
- milestones.should_not be_blank
54
- end
55
-
56
- it "should complete milestone with the given id" do
57
- milestone = @basecamp.milestones(2388627).first
58
- @basecamp.complete_milestone(milestone.id)
59
-
60
- Basecamp::Base.establish_connection!('flatsoft-test.grouphub.com', 'flatsoft', '123456')
61
-
62
- milestone = @basecamp.milestones(2388627).first
63
- milestone.completed.should == true
64
- end
65
-
66
- it "should uncomplete milestone with the given id" do
67
- milestone = @basecamp.milestones(2388627).first
68
- @basecamp.uncomplete_milestone(milestone.id)
69
-
70
- Basecamp::Base.establish_connection!('flatsoft-test.grouphub.com', 'flatsoft', '123456')
71
-
72
- milestone = @basecamp.milestones(2388627).first
73
- milestone.completed.should == false
74
- end
75
- end
@@ -1,42 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
2
- require File.dirname(__FILE__) + '/../../lib/basecamp.rb'
3
-
4
- describe Basecamp::Message do
5
-
6
- before(:each) do
7
- Basecamp::Base.establish_connection!('flatsoft-test.grouphub.com', 'flatsoft', '123456')
8
- end
9
-
10
- it "should return the most recent 25 messages in the given project" do
11
- messages = Basecamp::Message.list(2388627)
12
- messages.should_not be_blank
13
- messages.should be_kind_of(Array)
14
- messages.size.should_not > 25
15
- end
16
-
17
- it "should get a list of messages for given project and specified category" do
18
- messages = Basecamp::Message.list(2388627, :category_id => 23864732)
19
- messages.should_not be_blank
20
- messages.should be_kind_of(Array)
21
- messages.each{ |m| m.category_id.should == 23864732 }
22
- end
23
-
24
- it "should return a summary of all messages in the given project" do
25
- messages = Basecamp::Message.archive(2388627)
26
- messages.should_not be_blank
27
- messages.should be_kind_of(Array)
28
- end
29
-
30
- it "should return a summary of all messages in the given project and specified category " do
31
- messages = Basecamp::Message.archive(2388627, :category_id => 23864732)
32
- messages.should_not be_blank
33
- messages.should be_kind_of(Array)
34
- end
35
-
36
- it "should return list of message comments" do
37
- message = Basecamp::Message.find(15797423)
38
- comments = message.comments
39
- comments.should_not be_blank
40
- comments.should be_kind_of(Array)
41
- end
42
- end
@@ -1,40 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
2
- require File.dirname(__FILE__) + '/../../lib/basecamp.rb'
3
-
4
- describe Basecamp::TodoItem do
5
-
6
- before(:each) do
7
- Basecamp::Base.establish_connection!('flatsoft-test.grouphub.com', 'flatsoft', '123456')
8
- end
9
-
10
- it "should have todo list" do
11
- todo = Basecamp::TodoItem.find(32416216)
12
- todo.todo_list.should_not be_blank
13
- end
14
-
15
- it "should return list of comments" do
16
- todo = Basecamp::TodoItem.find(32416216)
17
- todo.comments.should_not be_blank
18
- todo.comments.should be_kind_of(Array)
19
- end
20
-
21
- it "should complete todo item" do
22
- todo = Basecamp::TodoItem.find(32416216)
23
- todo.complete!
24
-
25
- Basecamp::Base.establish_connection!('flatsoft-test.grouphub.com', 'flatsoft', '123456')
26
-
27
- todo = Basecamp::TodoItem.find(32416216)
28
- todo.completed.should == true
29
- end
30
-
31
- it "should uncomplete todo item" do
32
- todo = Basecamp::TodoItem.find(32416216)
33
- todo.uncomplete!
34
-
35
- Basecamp::Base.establish_connection!('flatsoft-test.grouphub.com', 'flatsoft', '123456')
36
-
37
- todo = Basecamp::TodoItem.find(32416216)
38
- todo.completed.should == false
39
- end
40
- end
@@ -1,32 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
2
- require File.dirname(__FILE__) + '/../../lib/basecamp.rb'
3
-
4
- describe Basecamp::TodoList do
5
-
6
- before(:each) do
7
- Basecamp::Base.establish_connection!('flatsoft-test.grouphub.com', 'flatsoft', '123456')
8
- end
9
-
10
- it "should return todo items" do
11
- list = Basecamp::TodoList.find(4501767)
12
- list.todo_items.should_not be_blank
13
- list.todo_items.should be_kind_of(Array)
14
- end
15
-
16
- it "should return all lists for a specified project" do
17
- list = Basecamp::TodoList.all(2388627)
18
- list.should_not be_blank
19
- end
20
-
21
- it "should return all finished lists for a specified project" do
22
- list = Basecamp::TodoList.all(2388627, true)
23
- list.should_not be_blank
24
- list.each { |item| item.complete.should == "true" }
25
- end
26
-
27
- it "should return all pending lists for a specified project" do
28
- list = Basecamp::TodoList.all(2388627, false)
29
- list.should_not be_blank
30
- list.each { |item| item.complete.should == "false" }
31
- end
32
- end