Commit 7ed0a06533e43d1c8a2f7e5ba3cae0592b6b0b77
1 parent
34f9be8a
Exists in
colab
and in
4 other branches
Changed KalibroConfigurationAttributes public default to true
Fixed kalibro_configuration acceptance tests. Signed off by: Pedro Scocco <pedroscocco@gmail.com>
Showing
5 changed files
with
17 additions
and
8 deletions
Show diff stats
db/migrate/20150515193445_change_kalibro_configuration_attributes_public_default.rb
0 → 100644
@@ -0,0 +1,9 @@ | @@ -0,0 +1,9 @@ | ||
1 | +class ChangeKalibroConfigurationAttributesPublicDefault < ActiveRecord::Migration | ||
2 | + def up | ||
3 | + change_column_default :kalibro_configuration_attributes, :public, true | ||
4 | + end | ||
5 | + | ||
6 | + def down | ||
7 | + change_column_default :kalibro_configuration_attributes, :public, false | ||
8 | + end | ||
9 | +end |
db/schema.rb
@@ -11,14 +11,14 @@ | @@ -11,14 +11,14 @@ | ||
11 | # | 11 | # |
12 | # It's strongly recommended that you check this file into your version control system. | 12 | # It's strongly recommended that you check this file into your version control system. |
13 | 13 | ||
14 | -ActiveRecord::Schema.define(version: 20150511181035) do | 14 | +ActiveRecord::Schema.define(version: 20150515193445) do |
15 | 15 | ||
16 | create_table "kalibro_configuration_attributes", force: :cascade do |t| | 16 | create_table "kalibro_configuration_attributes", force: :cascade do |t| |
17 | t.integer "user_id" | 17 | t.integer "user_id" |
18 | t.integer "kalibro_configuration_id" | 18 | t.integer "kalibro_configuration_id" |
19 | t.datetime "created_at" | 19 | t.datetime "created_at" |
20 | t.datetime "updated_at" | 20 | t.datetime "updated_at" |
21 | - t.boolean "public", default: false | 21 | + t.boolean "public", default: true |
22 | end | 22 | end |
23 | 23 | ||
24 | create_table "project_attributes", force: :cascade do |t| | 24 | create_table "project_attributes", force: :cascade do |t| |
features/kalibro_configuration/listing.feature
@@ -27,4 +27,4 @@ Feature: Configuration listing | @@ -27,4 +27,4 @@ Feature: Configuration listing | ||
27 | And I have a sample configuration | 27 | And I have a sample configuration |
28 | And I am at the All Configurations page | 28 | And I am at the All Configurations page |
29 | When I click the Show link | 29 | When I click the Show link |
30 | - Then the sample configuration should be there | ||
31 | \ No newline at end of file | 30 | \ No newline at end of file |
31 | + Then the sample configuration should be there |
features/step_definitions/kalibro_configuration_steps.rb
@@ -12,11 +12,12 @@ end | @@ -12,11 +12,12 @@ end | ||
12 | 12 | ||
13 | Given(/^I have a sample configuration$/) do | 13 | Given(/^I have a sample configuration$/) do |
14 | @kalibro_configuration = FactoryGirl.create(:kalibro_configuration) | 14 | @kalibro_configuration = FactoryGirl.create(:kalibro_configuration) |
15 | + FactoryGirl.create(:kalibro_configuration_attributes, {id: nil, user_id: nil, kalibro_configuration_id: @kalibro_configuration.id}) | ||
15 | end | 16 | end |
16 | 17 | ||
17 | Given(/^I own a sample configuration$/) do | 18 | Given(/^I own a sample configuration$/) do |
18 | @kalibro_configuration = FactoryGirl.create(:kalibro_configuration) | 19 | @kalibro_configuration = FactoryGirl.create(:kalibro_configuration) |
19 | - FactoryGirl.create(:kalibro_configuration_ownership, {id: nil, user_id: @user.id, kalibro_configuration_id: @kalibro_configuration.id}) | 20 | + FactoryGirl.create(:kalibro_configuration_attributes, {id: nil, user_id: @user.id, kalibro_configuration_id: @kalibro_configuration.id}) |
20 | end | 21 | end |
21 | 22 | ||
22 | Given(/^I am at the Sample Configuration page$/) do | 23 | Given(/^I am at the Sample Configuration page$/) do |
@@ -29,7 +30,7 @@ end | @@ -29,7 +30,7 @@ end | ||
29 | 30 | ||
30 | Given(/^I own a configuration named "(.*?)"$/) do |name| | 31 | Given(/^I own a configuration named "(.*?)"$/) do |name| |
31 | @kalibro_configuration = FactoryGirl.create(:kalibro_configuration, {name: name}) | 32 | @kalibro_configuration = FactoryGirl.create(:kalibro_configuration, {name: name}) |
32 | - FactoryGirl.create(:kalibro_configuration_ownership, {id: nil, user_id: @user.id, kalibro_configuration_id: @kalibro_configuration.id}) | 33 | + FactoryGirl.create(:kalibro_configuration_attributes, {id: nil, user_id: @user.id, kalibro_configuration_id: @kalibro_configuration.id}) |
33 | end | 34 | end |
34 | 35 | ||
35 | When(/^I visit the sample configuration edit page$/) do | 36 | When(/^I visit the sample configuration edit page$/) do |
spec/factories/kalibro_configuration_attributes.rb
@@ -4,10 +4,9 @@ FactoryGirl.define do | @@ -4,10 +4,9 @@ FactoryGirl.define do | ||
4 | factory :kalibro_configuration_attributes, class: KalibroConfigurationAttributes do | 4 | factory :kalibro_configuration_attributes, class: KalibroConfigurationAttributes do |
5 | association :user, strategy: :build | 5 | association :user, strategy: :build |
6 | association :kalibro_configuration, :with_id, strategy: :build | 6 | association :kalibro_configuration, :with_id, strategy: :build |
7 | - self.public false | ||
8 | 7 | ||
9 | - trait :public do | ||
10 | - self.public true | 8 | + trait :private do |
9 | + self.public false | ||
11 | end | 10 | end |
12 | end | 11 | end |
13 | end | 12 | end |