tacokit 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +86 -0
- data/.travis.yml +6 -0
- data/Gemfile +16 -25
- data/Guardfile +1 -1
- data/README.md +61 -17
- data/Rakefile +10 -5
- data/lib/tacokit/authorization.rb +14 -13
- data/lib/tacokit/client/actions.rb +68 -28
- data/lib/tacokit/client/boards.rb +92 -85
- data/lib/tacokit/client/cards.rb +285 -92
- data/lib/tacokit/client/checklists.rb +48 -28
- data/lib/tacokit/client/labels.rb +14 -16
- data/lib/tacokit/client/lists.rb +52 -28
- data/lib/tacokit/client/members.rb +56 -46
- data/lib/tacokit/client/notifications.rb +13 -27
- data/lib/tacokit/client/organizations.rb +0 -6
- data/lib/tacokit/client/searches.rb +0 -1
- data/lib/tacokit/client/tokens.rb +0 -6
- data/lib/tacokit/client/types.rb +0 -1
- data/lib/tacokit/client/webhooks.rb +3 -8
- data/lib/tacokit/client.rb +48 -75
- data/lib/tacokit/collection.rb +49 -0
- data/lib/tacokit/configuration.rb +4 -6
- data/lib/tacokit/error.rb +0 -2
- data/lib/tacokit/middleware/boom.rb +6 -7
- data/lib/tacokit/middleware.rb +2 -10
- data/lib/tacokit/resource.rb +84 -57
- data/lib/tacokit/response.rb +3 -3
- data/lib/tacokit/transform.rb +35 -13
- data/lib/tacokit/utils.rb +40 -8
- data/lib/tacokit/version.rb +1 -1
- data/lib/tacokit.rb +0 -2
- data/spec/cassettes/Tacokit_Client_Actions/_action_board/returns_action_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Actions/_action_card/returns_action_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Actions/_action_entities/returns_action_entities.json +1 -0
- data/spec/cassettes/Tacokit_Client_Actions/_action_list/returns_action_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_add_board_member/adds_invites_member_to_board.json +1 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_actions/returns_board_actions.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_cards/returns_board_cards.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_checklists/returns_board_checklists.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_labels/returns_board_labels.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_lists/returns_board_lists.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_members/returns_board_members.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_organization/returns_board_organization.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_preferences/returns_preferences_for_a_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_stars/returns_board_stars.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_member_board_stars/returns_board_stars.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_update_board_member/updates_member.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_add_comment/creates_a_comment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_add_label/adds_label_to_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_add_member_to_card/adds_member_to_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_archive_card/archives_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_archive_card/restore_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_an_attachment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_attachment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_attachments.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_card_resource.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_id.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_short_link.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_actions/returns_card_actions.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_board/returns_card_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_field/returns_a_hash.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_field/returns_a_value.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_field/returns_an_array.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_list/returns_a_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members_voted.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_resource/returns_card_actions.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_resource/returns_card_board.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_resource/returns_card_check_item_states.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_stickers/returns_.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_check_item_states.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_checklists.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_create_card/creates_a_card.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/attaches_external_url.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/uploads_local_file.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_delete_card/deletes_a_card.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_delete_card_resource/deletes_resource.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_delete_comment/deletes_comment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_list/returns_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_a_new_position.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_another_board_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/raises_error_if_missing_options.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/adds_a_checklist_item.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/adds_new_checklist_by_name.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/copies_a_checklist_by_id.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_stickers/returns_stickers.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_update_card/updates_a_card.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_update_checklist_item/updates_checklist_item.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_update_comment/updates_a_comment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_vote/adds_a_member_s_vote_to_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Checklists/_check_items/adds_a_checklist_check_item.json +1 -0
- data/spec/cassettes/Tacokit_Client_Checklists/_check_items/retrieves_checklist_check_items.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_archive_list_cards/should_archive_cards_in_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_list_actions/returns_list_actions.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_list_board/returns_list_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_list_cards/returns_list_cards.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_move_list_cards/should_move_cards_in_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_actions/returns_member_actions.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_board_stars/returns_member_board_stars.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_boards/returns_member_boards.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_cards/returns_member_cards.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_notifications/returns_member_notifications.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_organizations/returns_member_organizations.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_tokens/returns_member_organizations.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_tokens/returns_member_tokens.json +1 -0
- data/spec/spec_helper.rb +39 -29
- data/spec/tacokit/authorization_spec.rb +11 -11
- data/spec/tacokit/client/actions_spec.rb +56 -19
- data/spec/tacokit/client/boards_spec.rb +81 -78
- data/spec/tacokit/client/cards_spec.rb +322 -68
- data/spec/tacokit/client/checklists_spec.rb +29 -27
- data/spec/tacokit/client/labels_spec.rb +8 -16
- data/spec/tacokit/client/lists_spec.rb +74 -27
- data/spec/tacokit/client/members_spec.rb +55 -41
- data/spec/tacokit/client/notifications_spec.rb +3 -31
- data/spec/tacokit/client/organizations_spec.rb +6 -27
- data/spec/tacokit/client/searches_spec.rb +1 -3
- data/spec/tacokit/client/tokens_spec.rb +2 -18
- data/spec/tacokit/client/types_spec.rb +2 -3
- data/spec/tacokit/client/webhooks_spec.rb +6 -14
- data/spec/tacokit/client_spec.rb +3 -3
- data/spec/tacokit/configuration_spec.rb +30 -31
- data/spec/tacokit/middleware/boom_spec.rb +6 -7
- data/spec/tacokit/resource_spec.rb +142 -17
- data/spec/tacokit/transform_spec.rb +37 -35
- data/spec/tacokit_spec.rb +3 -5
- data/tacokit.gemspec +6 -6
- metadata +132 -15
- data/config.ru +0 -7
- data/lib/tacokit/middleware/debug.rb +0 -22
- data/spec/cassettes/Tacokit_Client_Boards/_update_board_resource/updates_member.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_member/raises_error_for_missing_token.json +0 -1
@@ -1,12 +1,12 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Tacokit::Client::Actions do
|
4
4
|
def test_action_id
|
5
|
-
|
5
|
+
"548e3153ea7ca8f9cd3cb77b"
|
6
6
|
end
|
7
7
|
|
8
8
|
def test_card_id
|
9
|
-
|
9
|
+
"548dd95c8ca25ac9d0d9ce71"
|
10
10
|
end
|
11
11
|
|
12
12
|
describe "#action", :vcr do
|
@@ -17,7 +17,7 @@ describe Tacokit::Client::Actions do
|
|
17
17
|
expect(action.data).to be_any
|
18
18
|
end
|
19
19
|
|
20
|
-
it
|
20
|
+
it "returns oauth authorized board" do
|
21
21
|
action = oauth_client.action(test_action_id)
|
22
22
|
|
23
23
|
expect(action.type).to be_present
|
@@ -25,37 +25,74 @@ describe Tacokit::Client::Actions do
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
describe "#
|
29
|
-
|
30
|
-
|
28
|
+
describe "#action_board", :vcr do
|
29
|
+
before do
|
30
|
+
@action = app_client.add_comment(test_card_id, "Get action resource test. Booya!")
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
+
it "returns action board" do
|
34
|
+
board = app_client.action_board(@action.id)
|
35
|
+
|
36
|
+
expect(board.name).to be_present
|
33
37
|
end
|
34
38
|
|
35
|
-
|
36
|
-
|
39
|
+
after do
|
40
|
+
app_client.delete_action(@action.id)
|
41
|
+
end
|
42
|
+
end
|
37
43
|
|
38
|
-
|
44
|
+
describe "#action_card", :vcr do
|
45
|
+
before do
|
46
|
+
@action = app_client.add_comment(test_card_id, "Get action resource test. Booya!")
|
47
|
+
end
|
48
|
+
|
49
|
+
it "returns action card" do
|
50
|
+
card = app_client.action_card(@action.id)
|
51
|
+
|
52
|
+
expect(card.name).to be_present
|
53
|
+
end
|
54
|
+
|
55
|
+
after do
|
56
|
+
app_client.delete_action(@action.id)
|
39
57
|
end
|
40
58
|
end
|
41
59
|
|
42
|
-
describe "#
|
60
|
+
describe "#action_entities", :vcr do
|
61
|
+
before do
|
62
|
+
@action = app_client.add_comment(test_card_id, "Get action resource test. Booya!")
|
63
|
+
end
|
64
|
+
|
43
65
|
it "returns action entities" do
|
44
|
-
entities = app_client.
|
66
|
+
entities = app_client.action_entities(@action.id)
|
45
67
|
|
46
68
|
expect(entities).to be_any
|
69
|
+
expect(entities.map(&:type)).to include("comment")
|
47
70
|
end
|
48
71
|
|
49
|
-
|
50
|
-
|
72
|
+
after do
|
73
|
+
app_client.delete_action(@action.id)
|
74
|
+
end
|
75
|
+
end
|
51
76
|
|
52
|
-
|
77
|
+
describe "#action_list", :vcr do
|
78
|
+
before do
|
79
|
+
@action = app_client.add_comment(test_card_id, "Get action resource test. Booya!")
|
80
|
+
end
|
81
|
+
|
82
|
+
it "returns action list" do
|
83
|
+
list = app_client.action_list(@action.id)
|
84
|
+
|
85
|
+
expect(list.name).to be_present
|
86
|
+
end
|
87
|
+
|
88
|
+
after do
|
89
|
+
app_client.delete_action(@action.id)
|
53
90
|
end
|
54
91
|
end
|
55
92
|
|
56
93
|
describe "#update_action", :vcr do
|
57
94
|
before do
|
58
|
-
@action = app_client.
|
95
|
+
@action = app_client.add_comment(test_card_id, "Update action test. Booya!")
|
59
96
|
end
|
60
97
|
|
61
98
|
it "updates an action" do
|
@@ -71,7 +108,7 @@ describe Tacokit::Client::Actions do
|
|
71
108
|
|
72
109
|
describe "#update_action_text", :vcr do
|
73
110
|
before do
|
74
|
-
@action = app_client.
|
111
|
+
@action = app_client.add_comment test_card_id, "Update action test. Booya!"
|
75
112
|
end
|
76
113
|
|
77
114
|
it "updates an action" do
|
@@ -87,7 +124,7 @@ describe Tacokit::Client::Actions do
|
|
87
124
|
|
88
125
|
describe "#delete_action", :vcr do
|
89
126
|
before do
|
90
|
-
@action = app_client.
|
127
|
+
@action = app_client.add_comment(test_card_id, text: "Delete action test. Booya!")
|
91
128
|
end
|
92
129
|
|
93
130
|
it "deletes an action" do
|
@@ -1,89 +1,124 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Tacokit::Client::Boards do
|
4
|
-
def test_board_link
|
5
|
-
'swezQ9XS'
|
6
|
-
end
|
7
|
-
|
8
|
-
def test_board_id
|
9
|
-
'548a675581d1d669c9e8184e'
|
10
|
-
end
|
11
|
-
|
12
4
|
describe "#board", :vcr do
|
13
5
|
it "returns a token authorized board" do
|
14
6
|
board = app_client.board(test_board_link)
|
15
7
|
|
16
|
-
expect(board.name).to eq(
|
8
|
+
expect(board.name).to eq("Test Board")
|
17
9
|
end
|
18
10
|
|
19
|
-
it
|
11
|
+
it "returns oauth authorized board" do
|
20
12
|
board = oauth_client.board(test_board_link)
|
21
13
|
|
22
|
-
expect(board.name).to eq(
|
14
|
+
expect(board.name).to eq("Test Board")
|
23
15
|
end
|
24
16
|
end
|
25
17
|
|
26
|
-
describe "#
|
27
|
-
it "returns
|
28
|
-
|
18
|
+
describe "#board_actions", :vcr do
|
19
|
+
it "returns board actions" do
|
20
|
+
actions = app_client.board_actions(test_board_link)
|
21
|
+
|
22
|
+
expect(actions).not_to be_empty
|
29
23
|
|
30
|
-
|
24
|
+
action = actions.first
|
25
|
+
expect(action.member_creator.full_name).to be_present
|
31
26
|
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "#board_stars", :vcr do
|
30
|
+
it "returns board stars" do
|
31
|
+
stars = app_client.board_stars(test_board_link)
|
32
32
|
|
33
|
-
|
34
|
-
power_ups = app_client.board_field(test_board_link, :power_ups)
|
33
|
+
expect(stars).not_to be_empty
|
35
34
|
|
36
|
-
expect(
|
35
|
+
expect(stars.first.board_id).to eq(test_board_id)
|
37
36
|
end
|
37
|
+
end
|
38
38
|
|
39
|
-
|
40
|
-
|
39
|
+
describe "#board_cards", :vcr do
|
40
|
+
it "returns board cards" do
|
41
|
+
cards = app_client.board_cards(test_board_link)
|
41
42
|
|
42
|
-
expect(
|
43
|
+
expect(cards).not_to be_empty
|
44
|
+
|
45
|
+
card = cards.first
|
46
|
+
expect(card.pos).to be_present
|
43
47
|
end
|
44
48
|
end
|
45
49
|
|
46
|
-
describe "#
|
47
|
-
it "returns board
|
48
|
-
|
50
|
+
describe "#board_checklists", :vcr do
|
51
|
+
it "returns board checklists" do
|
52
|
+
checklists = app_client.board_checklists(test_board_link)
|
49
53
|
|
50
|
-
expect(
|
54
|
+
expect(checklists).not_to be_empty
|
51
55
|
|
52
|
-
|
53
|
-
expect(
|
56
|
+
checklist = checklists.first
|
57
|
+
expect(checklist.name).to eq "Test Checklist 1"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe "#board_labels", :vcr do
|
62
|
+
it "returns board labels" do
|
63
|
+
labels = app_client.board_labels(test_board_link)
|
64
|
+
|
65
|
+
expect(labels).not_to be_empty
|
66
|
+
|
67
|
+
label = labels.first
|
68
|
+
expect(label.name).to eq "Blue Label"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "#board_lists", :vcr do
|
73
|
+
it "returns board lists" do
|
74
|
+
lists = app_client.board_lists(test_board_link)
|
75
|
+
|
76
|
+
expect(lists).not_to be_empty
|
77
|
+
|
78
|
+
list = lists.first
|
79
|
+
expect(list.name).to eq "Test List 1"
|
54
80
|
end
|
81
|
+
end
|
55
82
|
|
83
|
+
describe "#board_members", :vcr do
|
56
84
|
it "returns board members" do
|
57
|
-
members = app_client.
|
85
|
+
members = app_client.board_members(test_board_link)
|
58
86
|
|
59
87
|
expect(members).not_to be_empty
|
60
88
|
|
61
89
|
member = members.first
|
62
|
-
expect(member.username).to
|
90
|
+
expect(member.username).to eq "rossta"
|
63
91
|
end
|
92
|
+
end
|
64
93
|
|
65
|
-
|
66
|
-
|
94
|
+
describe "#board_preferences", :vcr do
|
95
|
+
it "returns preferences for a board" do
|
96
|
+
prefs = app_client.board_preferences(test_board_link)
|
67
97
|
|
68
|
-
expect(
|
98
|
+
expect(prefs.show_sidebar).to be_truthy
|
99
|
+
end
|
100
|
+
end
|
69
101
|
|
70
|
-
|
71
|
-
|
102
|
+
describe "#board_organization", :vcr do
|
103
|
+
it "returns board organization" do
|
104
|
+
organization = app_client.board_organization(test_board_link)
|
105
|
+
|
106
|
+
expect(organization.name).to eq "teamtacokit"
|
72
107
|
end
|
73
108
|
end
|
74
109
|
|
75
110
|
describe "#update_board", :vcr do
|
76
111
|
it "updates a board" do
|
77
|
-
board = app_client.update_board(test_board_id, desc:
|
112
|
+
board = app_client.update_board(test_board_id, desc: "This board is for Tacokit testing")
|
78
113
|
|
79
|
-
expect(board.desc).to eq
|
114
|
+
expect(board.desc).to eq "This board is for Tacokit testing"
|
80
115
|
assert_requested :put, trello_url_template("boards/#{test_board_id}{?key,token}")
|
81
116
|
end
|
82
117
|
|
83
118
|
it "updates nested resource" do
|
84
|
-
board = app_client.update_board(test_board_id, label_names: { blue:
|
119
|
+
board = app_client.update_board(test_board_id, label_names: { blue: "Blue Label" })
|
85
120
|
|
86
|
-
expect(board.label_names.to_attrs).to include blue:
|
121
|
+
expect(board.label_names.to_attrs).to include blue: "Blue Label"
|
87
122
|
end
|
88
123
|
end
|
89
124
|
|
@@ -97,8 +132,8 @@ describe Tacokit::Client::Boards do
|
|
97
132
|
expect(@board.desc).to eq("This board was generated by tests")
|
98
133
|
assert_requested :post, trello_url_template("boards{?key,token}"),
|
99
134
|
body: {
|
100
|
-
|
101
|
-
|
135
|
+
"name" => "Autoboard",
|
136
|
+
"desc" => "This board was generated by tests"
|
102
137
|
}
|
103
138
|
end
|
104
139
|
|
@@ -107,43 +142,11 @@ describe Tacokit::Client::Boards do
|
|
107
142
|
end
|
108
143
|
end
|
109
144
|
|
110
|
-
describe "#create_board_resource", :vcr do
|
111
|
-
it "creates a board label" do
|
112
|
-
@label = label = app_client.create_board_resource test_board_id, 'labels', name: "Autolabel", color: 'blue'
|
113
|
-
|
114
|
-
expect(label.name).to eq "Autolabel"
|
115
|
-
expect(label.color).to eq "blue"
|
116
|
-
|
117
|
-
assert_requested :post, trello_url_template("boards/#{test_board_id}/labels{?key,token}"),
|
118
|
-
body: {
|
119
|
-
'name' => 'Autolabel',
|
120
|
-
'color' => 'blue'
|
121
|
-
}
|
122
|
-
app_client.delete_label @label.id
|
123
|
-
end
|
124
|
-
|
125
|
-
it "creates a board calendar key" do
|
126
|
-
key = app_client.create_board_resource test_board_id, 'calendar_key', 'generate', foo: 'bar'
|
127
|
-
|
128
|
-
expect(key.id).to_not be_nil
|
129
|
-
assert_requested :post, trello_url_template("boards/#{test_board_id}/calendarKey/generate{?key,token}")
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
describe "#update_board_field", :vcr do
|
134
|
-
it "updates a board field" do
|
135
|
-
board = app_client.update_board_field(test_board_id, 'desc', 'This board is for Tacokit testing')
|
136
|
-
|
137
|
-
expect(board.desc).to eq 'This board is for Tacokit testing'
|
138
|
-
assert_requested :put, trello_url_template("boards/#{test_board_id}/desc{?key,token}"), body: { value: 'This board is for Tacokit testing' }
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
145
|
describe "#add_board_member", :vcr do
|
143
146
|
it "adds invites member to board" do
|
144
|
-
@member = member = app_client.add_board_member(test_board_id,
|
147
|
+
@member = member = app_client.add_board_member(test_board_id, "rossta+tacokit2@example.com", "Taco Kit2")
|
145
148
|
|
146
|
-
expect(member.email).to eq
|
149
|
+
expect(member.email).to eq "rossta+tacokit2@example.com"
|
147
150
|
end
|
148
151
|
|
149
152
|
after do
|
@@ -151,13 +154,13 @@ describe Tacokit::Client::Boards do
|
|
151
154
|
end
|
152
155
|
end
|
153
156
|
|
154
|
-
describe "#
|
157
|
+
describe "#update_board_member", :vcr do
|
155
158
|
before do
|
156
|
-
@member = app_client.add_board_member(test_board_id,
|
159
|
+
@member = app_client.add_board_member(test_board_id, "rossta+tacokit@example.com", "Taco Kit3")
|
157
160
|
end
|
158
161
|
|
159
162
|
it "updates member" do
|
160
|
-
membership = app_client.
|
163
|
+
membership = app_client.update_board_member(test_board_id, @member.id, "normal")
|
161
164
|
expect(membership.id).to_not be_nil
|
162
165
|
end
|
163
166
|
|