Commit 0c9581741eb3742281627dfd34152df5d06abc2d
1 parent
7ed0a065
Exists in
colab
and in
4 other branches
Changed ReadingGroupAttributes public default to true
Signed off by: Pedro Scocco <pedroscocco@gmail.com>
Showing
4 changed files
with
15 additions
and
7 deletions
Show diff stats
db/migrate/20150515195059_change_reading_group_attributes_public_default.rb
0 → 100644
db/schema.rb
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
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: 20150515193445) do | 14 | +ActiveRecord::Schema.define(version: 20150515195059) 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" |
@@ -35,7 +35,7 @@ ActiveRecord::Schema.define(version: 20150515193445) do | @@ -35,7 +35,7 @@ ActiveRecord::Schema.define(version: 20150515193445) do | ||
35 | t.integer "reading_group_id" | 35 | t.integer "reading_group_id" |
36 | t.datetime "created_at" | 36 | t.datetime "created_at" |
37 | t.datetime "updated_at" | 37 | t.datetime "updated_at" |
38 | - t.boolean "public", default: false | 38 | + t.boolean "public", default: true |
39 | end | 39 | end |
40 | 40 | ||
41 | create_table "users", force: :cascade do |t| | 41 | create_table "users", force: :cascade do |t| |
features/step_definitions/reading_group_steps.rb
@@ -14,7 +14,7 @@ end | @@ -14,7 +14,7 @@ end | ||
14 | 14 | ||
15 | Given(/^I own a sample reading group$/) do | 15 | Given(/^I own a sample reading group$/) do |
16 | @reading_group = FactoryGirl.create(:reading_group) | 16 | @reading_group = FactoryGirl.create(:reading_group) |
17 | - FactoryGirl.create(:reading_group_ownership, {user_id: @user.id, reading_group_id: @reading_group.id}) | 17 | + FactoryGirl.create(:reading_group_attributes, {user_id: @user.id, reading_group_id: @reading_group.id}) |
18 | end | 18 | end |
19 | 19 | ||
20 | Given(/^I have a sample reading group$/) do | 20 | Given(/^I have a sample reading group$/) do |
@@ -31,7 +31,7 @@ end | @@ -31,7 +31,7 @@ end | ||
31 | 31 | ||
32 | Given(/^I own a reading group named "(.*?)"$/) do |name| | 32 | Given(/^I own a reading group named "(.*?)"$/) do |name| |
33 | @reading_group = FactoryGirl.create(:reading_group, {name: name}) | 33 | @reading_group = FactoryGirl.create(:reading_group, {name: name}) |
34 | - FactoryGirl.create(:reading_group_ownership, {user_id: @user.id, reading_group_id: @reading_group.id}) | 34 | + FactoryGirl.create(:reading_group_attributes, {user_id: @user.id, reading_group_id: @reading_group.id}) |
35 | end | 35 | end |
36 | 36 | ||
37 | When(/^I visit the sample reading group edit page$/) do | 37 | When(/^I visit the sample reading group edit page$/) do |
spec/factories/reading_group_attributes.rb
@@ -4,10 +4,9 @@ FactoryGirl.define do | @@ -4,10 +4,9 @@ FactoryGirl.define do | ||
4 | factory :reading_group_attributes, class: ReadingGroupAttributes do | 4 | factory :reading_group_attributes, class: ReadingGroupAttributes do |
5 | association :user, strategy: :build | 5 | association :user, strategy: :build |
6 | association :reading_group, :with_id, strategy: :build | 6 | association :reading_group, :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 |