Skip to content

Commit

Permalink
Merge pull request #4 from omgrr/remove_generated_checklists_from_cards
Browse files Browse the repository at this point in the history
Remove checklists on newly created cards
  • Loading branch information
chrissiedunham committed Dec 21, 2015
2 parents 83f2f5e + 0f5e9d5 commit 1da1319
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
10 changes: 1 addition & 9 deletions lib/github_to_trello/trello_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,11 @@ def _existing_card(issue)
end

def _create_card(issue)
card = Trello::Card.create(
Trello::Card.create(
:name => issue.title,
:list_id => inbox.id,
:desc => issue.body + "\n" + issue.html_url + "\n" + issue.updated_at.to_s,
)
_add_checklist_to(card)
card
end

def _add_checklist_to(card)
checklist = Trello::Checklist.create(:name => "Todo", :board_id => board.id)
checklist.add_item("Initial Response")
card.add_checklist(checklist)
end

def _board(id)
Expand Down
9 changes: 0 additions & 9 deletions spec/integration/trello_gateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,6 @@
expect(card.list.name).to eq("django_blog")
end

it "includes a checklist with item for initial response when creating cards" do
card = @gateway.create_or_update_card(@issue)
expect(card.checklists.length).to eq 1

checklist = card.checklists.first
expect(checklist.items.length).to eq 1
expect(checklist.items.first.name).to eq "Initial Response"
end

it "does not add a duplicate card if card exits in list already" do
card = @gateway.create_or_update_card(@issue)
card = @gateway.create_or_update_card(@issue)
Expand Down

0 comments on commit 1da1319

Please sign in to comment.