Sha256: bed5ba6539ee682fc852bad19098e4c20f7b3b70e22cc7421843bc1dcd6dffc3

Contents?: true

Size: 727 Bytes

Versions: 6

Compression:

Stored size: 727 Bytes

Contents

Then /^I should see the same "([^\"]*)" alternative (\d+) times$/ do |experiment, count|
  events = Metry.current.last_events(count.to_i)
  assert_equal count.to_i, events.size
  seen = events.collect{|e| e["experiment.#{experiment}"]}.uniq
  assert_equal 1, seen.size, "More than one seen in #{events.collect{|e| [e[:pk], e["visitor"], e["time"], e["experiment.#{experiment}"]]}.inspect}"
end

Then /^at least (\d+) should see alternative "([^\"]*)" of experiment "([^\"]*)"$/ do |count, alternative, experiment|
  events = Metry.current.all_events
  matching_count = events.select{|e| e["experiment:#{experiment}"] == alternative}.size
  assert matching_count > count.to_i, "#{matching_count} is not great than #{count}"
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
metry-2.0.4 radiant/example/features/step_definitions/experiments.rb
metry-2.0.5 radiant/example/features/step_definitions/experiments.rb
metry-2.0.0 radiant/example/features/step_definitions/experiments.rb
metry-2.0.1 radiant/example/features/step_definitions/experiments.rb
metry-2.0.2 radiant/example/features/step_definitions/experiments.rb
metry-2.0.3 radiant/example/features/step_definitions/experiments.rb