metric_configuration_steps.rb
1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Given(/^I have a sample metric configuration within the given mezuro configuration$/) do
@metric_configuration = FactoryGirl.create(:metric_configuration,
{id: nil, configuration_id: @mezuro_configuration.id, reading_group_id: @reading_group.id} )
end
Given(/^I have another metric configuration with code "(.*?)" within the given mezuro configuration$/) do |code|
@another_metric_configuration = FactoryGirl.create(:metric_configuration,
{id: nil, configuration_id: @mezuro_configuration.id, reading_group_id: @reading_group.id, code: code} )
end
When(/^I visit the sample metric configuration edit page$/) do
visit edit_mezuro_configuration_metric_configuration_path(@metric_configuration.configuration_id, @metric_configuration.id)
end
When(/^I visit the sample metric configuration page$/) do
visit mezuro_configuration_metric_configuration_path(@metric_configuration.configuration_id, @metric_configuration.id)
end
When(/^I visit the sample metric configuration page$/) do
visit edit_mezuro_configuration_path(@mezuro_configuration.id)
end
Then(/^I am at the sample metric configuration page$/) do
visit mezuro_configuration_metric_configuration_path(@metric_configuration.configuration_id, @metric_configuration.id)
page.should have_content(@metric_configuration.metric.name)
page.should have_content("Ranges")
end
Then(/^I should see the sample metric configuration content$/) do
page.should have_content(@metric_configuration.metric.name)
page.should have_content(@metric_configuration.code)
page.should have_content(@metric_configuration.weight)
end
Then(/^I should be at metric configuration sample page$/) do
page.should have_content(@metric_configuration.metric.name)
page.should have_content("Ranges")
end
Then(/^I should be at the choose metric page$/) do
page.should have_content("Choose a metric from a base tool:")
end