Skip to content

Commit

Permalink
refactor: make example data application names configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed May 9, 2019
1 parent 3c60437 commit a1d96b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/pact_broker/db/seed_example_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
module PactBroker
module DB
class SeedExampleData
CONSUMER_NAME = "Example App"
PROVIDER_NAME = "Example API"

def self.call
new.call
end

def call
def call(consumer_name: CONSUMER_NAME, provider_name: PROVIDER_NAME)
return unless database_empty?
PactBroker::Test::TestDataBuilder.new
.create_consumer("Example App", created_at: days_ago(16))
.create_provider("Example API", created_at: days_ago(16))
.create_consumer(consumer_name, created_at: days_ago(16))
.create_provider(provider_name, created_at: days_ago(16))
.create_consumer_version("e15da45d3943bf10793a6d04cfb9f5dabe430fe2", created_at: days_ago(16))
.create_consumer_version_tag("prod", created_at: days_ago(16))
.create_consumer_version_tag("dev", created_at: days_ago(16))
Expand Down

0 comments on commit a1d96b6

Please sign in to comment.