diff --git a/app/views/metric_configurations/_form.html.erb b/app/views/metric_configurations/_form.html.erb index a2489de..7b4f517 100644 --- a/app/views/metric_configurations/_form.html.erb +++ b/app/views/metric_configurations/_form.html.erb @@ -29,4 +29,3 @@
<%= f.submit 'Save', class: 'btn btn-primary' %> -<%= link_to 'Back', mezuro_configuration_path(@metric_configuration.configuration_id), class: 'btn btn-default' %> diff --git a/app/views/metric_configurations/edit.html.erb b/app/views/metric_configurations/edit.html.erb index 4d7c200..6e9c350 100644 --- a/app/views/metric_configurations/edit.html.erb +++ b/app/views/metric_configurations/edit.html.erb @@ -4,4 +4,5 @@ <%= form_for(@metric_configuration, :url => mezuro_configuration_metric_configuration_update_url(@mezuro_configuration_id, @metric_configuration.id), method: :put) do |f| %> <%= render partial: 'form', locals: {f: f} %> + <%= link_to 'Back', mezuro_configuration_path(@metric_configuration.configuration_id), class: 'btn btn-default' %> <% end %> diff --git a/app/views/metric_configurations/new.html.erb b/app/views/metric_configurations/new.html.erb index a6feb47..c6c3473 100644 --- a/app/views/metric_configurations/new.html.erb +++ b/app/views/metric_configurations/new.html.erb @@ -23,4 +23,5 @@ <%= form_for(@metric_configuration, :url => mezuro_configuration_metric_configurations_path(@metric_configuration.configuration_id)) do |f| %> <%= render partial: 'form', locals: {f: f} %> + <%= link_to 'Back', mezuro_configuration_choose_metric_path(@metric_configuration.configuration_id), class: 'btn btn-default' %> <% end %> diff --git a/features/metric_configuration/create.feature b/features/metric_configuration/create.feature index 8126361..9e81e31 100644 --- a/features/metric_configuration/create.feature +++ b/features/metric_configuration/create.feature @@ -26,4 +26,17 @@ Feature: Metric Configuration Creation When I press the Save button Then I should see "My Code" Then I should see "Total Lines of Code" - Then I should see "2" \ No newline at end of file + Then I should see "2" + + @kalibro_restart @javascript + Scenario: metric configuration creation + Given I am a regular user + And I am signed in + And I own a sample configuration + And I have a reading group named "Scholar" + And I am at the Sample Configuration page + And I click the Add Metric link + And I click the "Analizo" h3 + And I click the Total Lines of Code link + When I click the Back link + Then I should be at the choose metric page \ No newline at end of file diff --git a/features/step_definitions/metric_configuration_steps.rb b/features/step_definitions/metric_configuration_steps.rb index 09abe2b..f92fb2f 100644 --- a/features/step_definitions/metric_configuration_steps.rb +++ b/features/step_definitions/metric_configuration_steps.rb @@ -16,6 +16,10 @@ 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) @@ -28,12 +32,11 @@ Then(/^I should see the sample metric configuration content$/) do page.should have_content(@metric_configuration.weight) end -When(/^I visit the sample metric configuration page$/) do - visit edit_mezuro_configuration_path(@mezuro_configuration.id) -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 -- libgit2 0.21.2