Sha256: eeb48224cbc9cc718035e9671204ef06a19c6c117af404513730063b68de50d8

Contents?: true

Size: 1.9 KB

Versions: 4

Compression:

Stored size: 1.9 KB

Contents

Given /^a task_run does not exist$/ do
  TrackableTasks::TaskRun.nil?
end

Then (/^I should see "([^"]*)" $/) do |no_reconds|
  task_run = TrackableTasks::TaskRun.last
  page.should have_content(no_records)
end

Given /^a task_run exists$/ do
  TrackableTasks::TaskRun.create!(:start_time => Time.now, :task_type => 'Test Task', :success => true)
end

Given /^a task_run exists with the following values$/ do |table|
  attributes = {}  
  table.hashes.each do |key_pair|   
    if key_pair["key"] != 'key'      
      attributes[key_pair["key"]] = key_pair["value"]
    end     
  end  
  TrackableTasks::TaskRun.create!(attributes) 
end

Given /^end_time does not exist$/ do
  task_run = TrackableTasks::TaskRun.last
  task_run.end_time.nil?
end

Then /^I should see the data for that task_run$/ do
  task_run = TrackableTasks::TaskRun.last 
  page.should have_content(task_run.start_time.strftime('%D'))
  page.should have_content(task_run.task_type)
  page.should have_content(task_run.success)
end

Then (/^I should see "([^"]*)" in the run_time column$/) do |run_time_message|
  task_run = TrackableTasks::TaskRun.last
  task_run.run_time == run_time_message
end

Given /^success is true$/ do
  task_run = TrackableTasks::TaskRun.last
  task_run.success == true
end

Given /^there is no error_text$/ do
  task_run = TrackableTasks::TaskRun.last
  task_run.error_text.nil?
end

Then /^status_color should be green$/ do 
  task_run = TrackableTasks::TaskRun.last  
  page.body.should match("color: green") #had to use match here, have_content was not getting the html with css
end

Then /^I should see the show data for that task_run$/ do  
  task_run = TrackableTasks::TaskRun.last   
  page.should have_content(task_run.start_time.strftime('%D'))
  page.should have_content(task_run.task_type)
  page.should have_content(task_run.success)  
  page.should have_content(task_run.log_text)
  page.should have_content(task_run.error_text)
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trackable_tasks-0.1.3 spec/dummy/features/step_definitions/trackable_tasks_steps.rb
trackable_tasks-0.1.2 spec/dummy/features/step_definitions/trackable_tasks_steps.rb
trackable_tasks-0.1.1 spec/dummy/features/step_definitions/trackable_tasks_steps.rb
trackable_tasks-0.1.0 spec/dummy/features/step_definitions/trackable_tasks_steps.rb