Commit fac4ffc10904dbdb5e7846168804271a824f7073

Authored by Rafael Manzo
1 parent 96a5268a

Added ranges to the configuration used on repository acceptance tests

features/repository/show.feature
... ... @@ -91,7 +91,7 @@ Feature: Show Repository
91 91 And I click on the sample child's name
92 92 Then I should see a sample child's name
93 93  
94   - @kalibro_restart @wip
  94 + @kalibro_restart @javascript @wip
95 95 Scenario: Should show the graphic of a given metric
96 96 Given I am a regular user
97 97 And I am signed in
... ... @@ -106,4 +106,3 @@ Feature: Show Repository
106 106 When I visit the repository show page
107 107 And I see a sample metric's name
108 108 When I click on the sample metric's name
109   -
... ...
features/step_definitions/repository_steps.rb
1 1 Given(/^I have a sample configuration with native metrics$/) do
2 2 reading_group = FactoryGirl.create(:reading_group, id: nil)
  3 + reading = FactoryGirl.create(:reading, {id: nil, group_id: reading_group.id})
  4 + range = FactoryGirl.build(:range, {id: nil, reading_id: reading.id, beginning: '-INF', :end => '+INF'})
3 5 @configuration = FactoryGirl.create(:configuration, id: nil)
4 6 metric_configuration = FactoryGirl.create(:metric_configuration,
5 7 {id: nil,
  8 + metric: FactoryGirl.build(:loc),
6 9 reading_group_id: reading_group.id,
7 10 configuration_id: @configuration.id})
  11 + range.save metric_configuration.id
8 12 end
9 13  
10 14 Given(/^I have a sample repository within the sample project$/) do
... ...
spec/factories/ranges.rb 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +# This file is part of KalibroEntities
  2 +# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
  3 +#
  4 +# This program is free software: you can redistribute it and/or modify
  5 +# it under the terms of the GNU General Public License as published by
  6 +# the Free Software Foundation, either version 3 of the License, or
  7 +# (at your option) any later version.
  8 +#
  9 +# This program is distributed in the hope that it will be useful,
  10 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 +# GNU General Public License for more details.
  13 +
  14 +# You should have received a copy of the GNU General Public License
  15 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  16 +
  17 +FactoryGirl.define do
  18 + factory :range, class: KalibroEntities::Entities::Range do
  19 + beginning 1.1
  20 + self.end 5.1
  21 + reading_id 3
  22 + comments "Comment"
  23 +
  24 + trait :another_comment do
  25 + comments "Another Comment"
  26 + end
  27 +
  28 + factory :another_range, traits: [:another_comment]
  29 + end
  30 +end
0 31 \ No newline at end of file
... ...
spec/factories/readings.rb 0 → 100644
... ... @@ -0,0 +1,25 @@
  1 +# This file is part of KalibroEntities
  2 +# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
  3 +#
  4 +# This program is free software: you can redistribute it and/or modify
  5 +# it under the terms of the GNU General Public License as published by
  6 +# the Free Software Foundation, either version 3 of the License, or
  7 +# (at your option) any later version.
  8 +#
  9 +# This program is distributed in the hope that it will be useful,
  10 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 +# GNU General Public License for more details.
  13 +
  14 +# You should have received a copy of the GNU General Public License
  15 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  16 +
  17 +FactoryGirl.define do
  18 + factory :reading, class: KalibroEntities::Entities::Reading do
  19 + id 42
  20 + label "Good"
  21 + grade 10.5
  22 + color "33DD33"
  23 + group_id 31
  24 + end
  25 +end
0 26 \ No newline at end of file
... ...