diff options
| -rw-r--r-- | db/migrate/20180108132310_create_workgroups.rb | 4 | ||||
| -rw-r--r-- | db/schema.rb | 12 | ||||
| -rw-r--r-- | spec/models/workgroup_spec.rb | 7 |
3 files changed, 14 insertions, 9 deletions
diff --git a/db/migrate/20180108132310_create_workgroups.rb b/db/migrate/20180108132310_create_workgroups.rb index c767e5ce9..4e441a58d 100644 --- a/db/migrate/20180108132310_create_workgroups.rb +++ b/db/migrate/20180108132310_create_workgroups.rb @@ -2,8 +2,8 @@ class CreateWorkgroups < ActiveRecord::Migration def change create_table :workgroups do |t| t.string :name - t.integer :line_referential, index: true, limit: 8 - t.integer :stop_area_referential, index: true, limit: 8 + t.integer :line_referential_id, index: true, limit: 8 + t.integer :stop_area_referential_id, index: true, limit: 8 t.timestamps null: false end diff --git a/db/schema.rb b/db/schema.rb index fdcc4963c..cfc4d4464 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -993,14 +993,14 @@ ActiveRecord::Schema.define(version: 20180108132310) do create_table "workgroups", id: :bigserial, force: :cascade do |t| t.string "name" - t.integer "line_referential", limit: 8 - t.integer "stop_area_referential", limit: 8 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.integer "line_referential_id", limit: 8 + t.integer "stop_area_referential_id", limit: 8 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "workgroups", ["line_referential"], name: "index_workgroups_on_line_referential", using: :btree - add_index "workgroups", ["stop_area_referential"], name: "index_workgroups_on_stop_area_referential", using: :btree + add_index "workgroups", ["line_referential_id"], name: "index_workgroups_on_line_referential_id", using: :btree + add_index "workgroups", ["stop_area_referential_id"], name: "index_workgroups_on_stop_area_referential_id", using: :btree add_foreign_key "access_links", "access_points", name: "aclk_acpt_fkey" add_foreign_key "api_keys", "organisations" diff --git a/spec/models/workgroup_spec.rb b/spec/models/workgroup_spec.rb index 9d18dbc4a..7d7b3cf87 100644 --- a/spec/models/workgroup_spec.rb +++ b/spec/models/workgroup_spec.rb @@ -1,5 +1,10 @@ require 'rails_helper' RSpec.describe Workgroup, type: :model do - pending "add some examples to (or delete) #{__FILE__}" + let( :workgroup ){ build_stubbed :workgroup } + + it 'is not valid without a stop_area_referential' do + workgroup.line_referential_id = 42 + expect( workgroup ).not_to be_valid + end end |
