Sha256: 163a3d6aef2748de7b0c1c9d5f2ffc1b130cd0e6b05ddc5746b85770858ee5fa
Contents?: true
Size: 1.87 KB
Versions: 2
Compression:
Stored size: 1.87 KB
Contents
module GitPivotal module FeatureHelpers module Pivotal def pivotal_project data[:pivotal_project] ||= ( PivotalTracker::Client.token = PIVOTAL_API_KEY PivotalTracker::Project.find(PIVOTAL_TEST_PROJECT)) end def created_cards data[:created_cards] ||= [] end def delete_created_cards created_cards.each { |card| (card.delete rescue nil) } end def current_card data[:current_card] end def refresh_current_card! set_current_card pivotal_project.stories.find(current_card.id) end def set_current_card(card) data[:current_card] = card end def create_test_story(type, options = {}) attrs = { :name => "a #{type}", :story_type => type.to_s, :current_state => "unstarted", :estimate => (type.to_s == "feature" ? 1 : nil) }.merge(options) story = pivotal_project.stories.create(attrs) set_current_card story created_cards << story # let data propagate on Pivotal sleep 4 pivotal_project.stories.find(story.id) story end def comment_on_story(options = {}) current_card.notes.create options # let data propagate on Pivotal sleep 4 end def update_test_story(options = {}) story = current_card || create_test_story("feature") attrs = { :current_state => "unstarted", :estimate => (story.story_type.to_s == "feature" ? 1 : nil) }.merge(options) story.update(attrs) # let data propagate on Pivotal sleep 4 pivotal_project.stories.find(story.id) story end end end end World(GitPivotal::FeatureHelpers::Pivotal)
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
git-pivotal-tracker-0.9.1 | features/support/dsl/pivotal.rb |
git-pivotal-tracker-0.9.0 | features/support/dsl/pivotal.rb |