Sha256: 1476ef2da3b28a447256ce01460faacde1efbdd52483d7ec568181690f255014

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

Given /^a diagnostic check named "([^"]*)" with the following statuses:$/ do |name, table|
  statuses = table.hashes[0]

  body = Class.new do
    include DiagnosticsCheck
    define_method(:passed)  { eval(statuses[:passed]) }
    define_method(:warning) { eval(statuses[:warning]) }
    define_method(:failed)  { eval(statuses[:failed]) }
  end

  Object.send(:remove_const, name) if Object.const_defined?(name)
  Object.const_set(name, body)
end

Given /^diagnostic check "([^"]*)" has the following data attributes:$/ do |name, table|
  data = diagnostic_check(name).data

  table.hashes[0].each do |k, v|
    data[k] = v
  end
end

Given /^diagnostic check "([^"]*)" has a data list: "([^"]*)"$/ do |name, list|
  diagnostic_check(name).data << list.split(',')
end

Then /^(?:|I )should see a (.+) diagnostic check named "([^"]*)"$/ do |status, name|
  with_scope(".diagnostic-check.#{status}") do
    page.should have_content(name)
  end
end

Then /^(?:|I )should see "([^"]*)" as the title$/ do |text|
  with_scope("#system-status") do
    page.should have_content(text)
  end
end

Then /^(?:|I )should see "([^"]*)" within diagnostic data$/ do |text|
  with_scope(".diagnostic-data") do
    page.should have_content(text)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
diagnostics-0.0.4 spec_rails/rails2/features/step_definitions/diagnostic_steps.rb
diagnostics-0.0.3 spec_rails/rails2/features/step_definitions/diagnostic_steps.rb