diff --git a/features/repository/show.feature b/features/repository/show.feature index 0380eaf..f16cb20 100644 --- a/features/repository/show.feature +++ b/features/repository/show.feature @@ -91,7 +91,7 @@ Feature: Show Repository And I click on the sample child's name Then I should see a sample child's name - @kalibro_restart @wip + @kalibro_restart @javascript @wip Scenario: Should show the graphic of a given metric Given I am a regular user And I am signed in @@ -106,4 +106,3 @@ Feature: Show Repository When I visit the repository show page And I see a sample metric's name When I click on the sample metric's name - diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index 352fb23..f58e120 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -1,10 +1,14 @@ Given(/^I have a sample configuration with native metrics$/) do reading_group = FactoryGirl.create(:reading_group, id: nil) + reading = FactoryGirl.create(:reading, {id: nil, group_id: reading_group.id}) + range = FactoryGirl.build(:range, {id: nil, reading_id: reading.id, beginning: '-INF', :end => '+INF'}) @configuration = FactoryGirl.create(:configuration, id: nil) metric_configuration = FactoryGirl.create(:metric_configuration, {id: nil, + metric: FactoryGirl.build(:loc), reading_group_id: reading_group.id, configuration_id: @configuration.id}) + range.save metric_configuration.id end Given(/^I have a sample repository within the sample project$/) do diff --git a/spec/factories/ranges.rb b/spec/factories/ranges.rb new file mode 100644 index 0000000..3d23b98 --- /dev/null +++ b/spec/factories/ranges.rb @@ -0,0 +1,30 @@ +# This file is part of KalibroEntities +# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +FactoryGirl.define do + factory :range, class: KalibroEntities::Entities::Range do + beginning 1.1 + self.end 5.1 + reading_id 3 + comments "Comment" + + trait :another_comment do + comments "Another Comment" + end + + factory :another_range, traits: [:another_comment] + end +end \ No newline at end of file diff --git a/spec/factories/readings.rb b/spec/factories/readings.rb new file mode 100644 index 0000000..a0c8606 --- /dev/null +++ b/spec/factories/readings.rb @@ -0,0 +1,25 @@ +# This file is part of KalibroEntities +# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +FactoryGirl.define do + factory :reading, class: KalibroEntities::Entities::Reading do + id 42 + label "Good" + grade 10.5 + color "33DD33" + group_id 31 + end +end \ No newline at end of file -- libgit2 0.21.2