ruby-trello-wgibbs 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/trello/card.rb +7 -0
  2. data/spec/card_spec.rb +9 -0
  3. metadata +1 -1
@@ -122,6 +122,13 @@ module Trello
122
122
  Client.delete("/cards/#{id}/members/#{member.id}")
123
123
  end
124
124
 
125
+ # Removes all members from this card
126
+ def remove_all_members
127
+ members.each do |member|
128
+ Client.delete("/cards/#{id}/members/#{member.id}")
129
+ end
130
+ end
131
+
125
132
  # Move this card to the given list
126
133
  def move_to_list(list)
127
134
  Client.put("/cards/#{id}/idList", {
@@ -155,6 +155,15 @@ module Trello
155
155
  Client.should_receive(:delete).with("/cards/abcdef123456789123456789/members/#{existing_member.id}")
156
156
  @card.remove_member(existing_member)
157
157
  end
158
+
159
+ it "allows all members to be removed from a card" do
160
+ members = [stub(:id => '1'), stub(:id => '2'), stub(:id => '3')]
161
+ @card.stub(:members => members)
162
+ Client.should_receive(:delete).with("/cards/abcdef123456789123456789/members/#{members[0].id}")
163
+ Client.should_receive(:delete).with("/cards/abcdef123456789123456789/members/#{members[1].id}")
164
+ Client.should_receive(:delete).with("/cards/abcdef123456789123456789/members/#{members[2].id}")
165
+ @card.remove_all_members
166
+ end
158
167
  end
159
168
 
160
169
  context "comments" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-trello-wgibbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: