diff options
85 files changed, 1002 insertions, 12 deletions
| diff --git a/app/models/chouette/company.rb b/app/models/chouette/company.rb index f324dbd04..94a23f008 100644 --- a/app/models/chouette/company.rb +++ b/app/models/chouette/company.rb @@ -8,6 +8,7 @@ class Chouette::Company < Chouette::ActiveRecord    validates_format_of :registration_number, :with => %r{\A[0-9A-Za-z_-]+\Z}, :allow_nil => true, :allow_blank => true    validates_presence_of :name +  validates_presence_of :objectid_format    validates_format_of :url, :with => %r{\Ahttps?:\/\/([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?\Z}, :allow_nil => true, :allow_blank => true    def self.nullable_attributes diff --git a/app/models/chouette/network.rb b/app/models/chouette/network.rb index 76c587141..dad1a17d2 100644 --- a/app/models/chouette/network.rb +++ b/app/models/chouette/network.rb @@ -12,6 +12,7 @@ class Chouette::Network < Chouette::ActiveRecord    validates_format_of :registration_number, :with => %r{\A[0-9A-Za-z_-]+\Z}, :allow_nil => true, :allow_blank => true    validates_presence_of :name +  validates_presence_of :objectid_format    def self.object_id_key      "PTNetwork" diff --git a/app/models/chouette/routing_constraint_zone.rb b/app/models/chouette/routing_constraint_zone.rb index 0e22acd42..124884830 100644 --- a/app/models/chouette/routing_constraint_zone.rb +++ b/app/models/chouette/routing_constraint_zone.rb @@ -5,7 +5,7 @@ class Chouette::RoutingConstraintZone < Chouette::TridentActiveRecord    belongs_to :route    has_array_of :stop_points, class_name: 'Chouette::StopPoint' -  validates_presence_of :name, :stop_points, :route +  validates_presence_of :name, :stop_points, :route, :objectid_format    # validates :stop_point_ids, length: { minimum: 2, too_short: I18n.t('activerecord.errors.models.routing_constraint_zone.attributes.stop_points.not_enough_stop_points') }    validate :stop_points_belong_to_route, :not_all_stop_points_selected diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb index 0735d9cae..7872581cb 100644 --- a/app/models/chouette/stop_area.rb +++ b/app/models/chouette/stop_area.rb @@ -64,7 +64,7 @@ class Chouette::StopArea < Chouette::ActiveRecord    end    def objectid_format -    "#{self.stop_area_referential.objectid_format}_attributes_support".camelcase.constantize +    "#{self.stop_area_referential.objectid_format}_attributes_support".camelcase.constantize if self.stop_area_referential.objectid_format    end    def coordinates diff --git a/app/models/chouette/stop_point.rb b/app/models/chouette/stop_point.rb index 99a893602..c4034e2d4 100644 --- a/app/models/chouette/stop_point.rb +++ b/app/models/chouette/stop_point.rb @@ -19,6 +19,8 @@ module Chouette      acts_as_list :scope => :route, top_of_list: 0 +    validates_presence_of :objectid_format +      validates_presence_of :stop_area      validate :stop_area_id_validation      def stop_area_id_validation diff --git a/app/models/chouette/time_table.rb b/app/models/chouette/time_table.rb index f4db0c3b1..6572dbfe4 100644 --- a/app/models/chouette/time_table.rb +++ b/app/models/chouette/time_table.rb @@ -52,6 +52,7 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord    accepts_nested_attributes_for :periods, :allow_destroy => :true    validates_presence_of :comment +  validates_presence_of :objectid_format    validates_associated :dates    validates_associated :periods diff --git a/app/models/concerns/default_netex_attributes_support.rb b/app/models/concerns/netex_attributes_support.rb index 4cf77ea65..d78528dbf 100644 --- a/app/models/concerns/default_netex_attributes_support.rb +++ b/app/models/concerns/netex_attributes_support.rb @@ -1,4 +1,4 @@ -module DefaultNetexAttributesSupport +module NetexAttributesSupport    extend ActiveSupport::Concern    included do diff --git a/app/models/concerns/object_id_format_to_line_referential.rb b/app/models/concerns/object_id_format_to_line_referential.rb index 205f7e4e2..9725be824 100644 --- a/app/models/concerns/object_id_format_to_line_referential.rb +++ b/app/models/concerns/object_id_format_to_line_referential.rb @@ -1,5 +1,11 @@  module ObjectIdFormatToLineReferential +  extend ActiveSupport::Concern + +  included do +    validates_presence_of :objectid_format +  end +    def objectid_format -    "#{self.line_referential.objectid_format}_attributes_support".camelcase.constantize +    "#{self.line_referential.objectid_format}_attributes_support".camelcase.constantize if self.line_referential.objectid_format    end  end diff --git a/app/models/concerns/object_id_format_to_referential.rb b/app/models/concerns/object_id_format_to_referential.rb index 2371aa0be..1b99acf17 100644 --- a/app/models/concerns/object_id_format_to_referential.rb +++ b/app/models/concerns/object_id_format_to_referential.rb @@ -1,5 +1,11 @@  module ObjectIdFormatToReferential +  extend ActiveSupport::Concern + +  included do +    validates_presence_of :objectid_format +  end +    def objectid_format -    "#{self.referential.objectid_format}_attributes_support".camelcase.constantize +    "#{self.referential.objectid_format}_attributes_support".camelcase.constantize if self.referential.objectid_format    end  end diff --git a/app/models/line_referential.rb b/app/models/line_referential.rb index cbe07e9b1..d81644080 100644 --- a/app/models/line_referential.rb +++ b/app/models/line_referential.rb @@ -10,7 +10,8 @@ class LineReferential < ActiveRecord::Base    has_many :networks, class_name: 'Chouette::Network'    has_many :line_referential_syncs, -> { order created_at: :desc }    has_many :workbenches -  enumerize :objectid_format, in: %w(default_netex stif_netex) +  enumerize :objectid_format, in: %w(netex stif_netex) +  validates_presence_of :objectid_format    def add_member(organisation, options = {})      attributes = options.merge organisation: organisation diff --git a/app/models/referential.rb b/app/models/referential.rb index e4721a405..87ac61f56 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -12,8 +12,6 @@ class Referential < ActiveRecord::Base    validates_uniqueness_of :slug -  validates_presence_of :line_referential -  validates_presence_of :stop_area_referential    validates_format_of :slug, :with => %r{\A[a-z][0-9a-z_]+\Z}    validates_format_of :prefix, :with => %r{\A[0-9a-zA-Z_]+\Z}    validates_format_of :upper_corner, :with => %r{\A-?[0-9]+\.?[0-9]*\,-?[0-9]+\.?[0-9]*\Z} @@ -56,7 +54,8 @@ class Referential < ActiveRecord::Base    belongs_to :referential_suite -  enumerize :objectid_format, in: %w(default_netex stif_netex) +  enumerize :objectid_format, in: %w(netex stif_netex) +  validates_presence_of :objectid_format    scope :ready, -> { where(ready: true) }    scope :in_periode, ->(periode) { where(id: referential_ids_in_periode(periode)) } diff --git a/app/models/stop_area_referential.rb b/app/models/stop_area_referential.rb index c05d6e6be..2ef1278d8 100644 --- a/app/models/stop_area_referential.rb +++ b/app/models/stop_area_referential.rb @@ -6,7 +6,8 @@ class StopAreaReferential < ActiveRecord::Base    has_many :stop_areas, class_name: 'Chouette::StopArea'    has_many :stop_area_referential_syncs, -> {order created_at: :desc}    has_many :workbenches -  enumerize :objectid_format, in: %w(default_netex stif_netex) +  enumerize :objectid_format, in: %w(netex stif_netex) +  validates_presence_of :objectid_format    def add_member(organisation, options = {})      attributes = options.merge organisation: organisation diff --git a/app/models/workbench.rb b/app/models/workbench.rb index 22cad0f7f..8a48b0f9f 100644 --- a/app/models/workbench.rb +++ b/app/models/workbench.rb @@ -4,7 +4,8 @@ class Workbench < ActiveRecord::Base    belongs_to :line_referential    belongs_to :stop_area_referential    belongs_to :output, class_name: 'ReferentialSuite' -  enumerize :objectid_format, in: %w(default_netex stif_netex) +  enumerize :objectid_format, in: %w(netex stif_netex) +  validates_presence_of :objectid_format    has_many :lines, -> (workbench) { Stif::MyWorkbenchScopes.new(workbench).line_scope(self) }, through: :line_referential    has_many :networks, through: :line_referential diff --git a/bin/bundle-audit b/bin/bundle-audit new file mode 100755 index 000000000..70ba44868 --- /dev/null +++ b/bin/bundle-audit @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'bundle-audit' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("bundler-audit", "bundle-audit") diff --git a/bin/bundler b/bin/bundler new file mode 100755 index 000000000..d6107f047 --- /dev/null +++ b/bin/bundler @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'bundler' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("bundler", "bundler") diff --git a/bin/byebug b/bin/byebug new file mode 100755 index 000000000..d9bf0f4eb --- /dev/null +++ b/bin/byebug @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'byebug' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("byebug", "byebug") diff --git a/bin/cap b/bin/cap new file mode 100755 index 000000000..d2c0b9e5a --- /dev/null +++ b/bin/cap @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'cap' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("capistrano", "cap") diff --git a/bin/capify b/bin/capify new file mode 100755 index 000000000..bdd2c8712 --- /dev/null +++ b/bin/capify @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'capify' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("capistrano", "capify") diff --git a/bin/coderay b/bin/coderay new file mode 100755 index 000000000..e248d2436 --- /dev/null +++ b/bin/coderay @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'coderay' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("coderay", "coderay") diff --git a/bin/cucumber b/bin/cucumber new file mode 100755 index 000000000..63ddc2afb --- /dev/null +++ b/bin/cucumber @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'cucumber' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("cucumber", "cucumber") diff --git a/bin/dbf b/bin/dbf new file mode 100755 index 000000000..081977293 --- /dev/null +++ b/bin/dbf @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'dbf' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("dbf", "dbf") diff --git a/bin/dot2ruby b/bin/dot2ruby new file mode 100755 index 000000000..585531cf7 --- /dev/null +++ b/bin/dot2ruby @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'dot2ruby' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("ruby-graphviz", "dot2ruby") diff --git a/bin/erd b/bin/erd new file mode 100755 index 000000000..c112d6420 --- /dev/null +++ b/bin/erd @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'erd' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rails-erd", "erd") diff --git a/bin/erubis b/bin/erubis new file mode 100755 index 000000000..9d0f9cb06 --- /dev/null +++ b/bin/erubis @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'erubis' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("erubis", "erubis") diff --git a/bin/gem2gv b/bin/gem2gv new file mode 100755 index 000000000..31f38af7c --- /dev/null +++ b/bin/gem2gv @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'gem2gv' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("ruby-graphviz", "gem2gv") diff --git a/bin/gherkin-ruby b/bin/gherkin-ruby new file mode 100755 index 000000000..490d35a71 --- /dev/null +++ b/bin/gherkin-ruby @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'gherkin-ruby' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("gherkin", "gherkin-ruby") diff --git a/bin/git2gv b/bin/git2gv new file mode 100755 index 000000000..6e5d0dac4 --- /dev/null +++ b/bin/git2gv @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'git2gv' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("ruby-graphviz", "git2gv") diff --git a/bin/htmlbeautifier b/bin/htmlbeautifier new file mode 100755 index 000000000..077ceda68 --- /dev/null +++ b/bin/htmlbeautifier @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'htmlbeautifier' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("htmlbeautifier", "htmlbeautifier") diff --git a/bin/htmldiff b/bin/htmldiff new file mode 100755 index 000000000..09c825951 --- /dev/null +++ b/bin/htmldiff @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'htmldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("diff-lcs", "htmldiff") diff --git a/bin/httparty b/bin/httparty new file mode 100755 index 000000000..110df0244 --- /dev/null +++ b/bin/httparty @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'httparty' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("httparty", "httparty") diff --git a/bin/i18n-tasks b/bin/i18n-tasks new file mode 100755 index 000000000..bd0dddcaa --- /dev/null +++ b/bin/i18n-tasks @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'i18n-tasks' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("i18n-tasks", "i18n-tasks") diff --git a/bin/launchy b/bin/launchy new file mode 100755 index 000000000..a86ca1756 --- /dev/null +++ b/bin/launchy @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'launchy' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("launchy", "launchy") diff --git a/bin/ldiff b/bin/ldiff new file mode 100755 index 000000000..a5e9564aa --- /dev/null +++ b/bin/ldiff @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'ldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("diff-lcs", "ldiff") diff --git a/bin/license_finder b/bin/license_finder new file mode 100755 index 000000000..d5ef03fc6 --- /dev/null +++ b/bin/license_finder @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'license_finder' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("license_finder", "license_finder") diff --git a/bin/license_finder_pip.py b/bin/license_finder_pip.py new file mode 100755 index 000000000..6a1c91be3 --- /dev/null +++ b/bin/license_finder_pip.py @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'license_finder_pip.py' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("license_finder", "license_finder_pip.py") diff --git a/bin/mongrel_rpm b/bin/mongrel_rpm new file mode 100755 index 000000000..20cb86dc8 --- /dev/null +++ b/bin/mongrel_rpm @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'mongrel_rpm' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("newrelic_rpm", "mongrel_rpm") diff --git a/bin/newrelic b/bin/newrelic new file mode 100755 index 000000000..7a2008dda --- /dev/null +++ b/bin/newrelic @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'newrelic' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("newrelic_rpm", "newrelic") diff --git a/bin/newrelic_cmd b/bin/newrelic_cmd new file mode 100755 index 000000000..02d32467c --- /dev/null +++ b/bin/newrelic_cmd @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'newrelic_cmd' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("newrelic_rpm", "newrelic_cmd") diff --git a/bin/nokogiri b/bin/nokogiri new file mode 100755 index 000000000..c1f0ca44f --- /dev/null +++ b/bin/nokogiri @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'nokogiri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("nokogiri", "nokogiri") diff --git a/bin/nrdebug b/bin/nrdebug new file mode 100755 index 000000000..3878e8590 --- /dev/null +++ b/bin/nrdebug @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'nrdebug' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("newrelic_rpm", "nrdebug") diff --git a/bin/pry b/bin/pry new file mode 100755 index 000000000..743a1337b --- /dev/null +++ b/bin/pry @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'pry' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("pry", "pry") diff --git a/bin/rackup b/bin/rackup new file mode 100755 index 000000000..0f074e64e --- /dev/null +++ b/bin/rackup @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'rackup' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rack", "rackup") diff --git a/bin/rdoc b/bin/rdoc new file mode 100755 index 000000000..c051912da --- /dev/null +++ b/bin/rdoc @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'rdoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rdoc", "rdoc") diff --git a/bin/redcloth b/bin/redcloth new file mode 100755 index 000000000..02d94175d --- /dev/null +++ b/bin/redcloth @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'redcloth' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("RedCloth", "redcloth") @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'ri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rdoc", "ri") diff --git a/bin/ruby-parse b/bin/ruby-parse new file mode 100755 index 000000000..20557e7b3 --- /dev/null +++ b/bin/ruby-parse @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'ruby-parse' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("parser", "ruby-parse") diff --git a/bin/ruby-rewrite b/bin/ruby-rewrite new file mode 100755 index 000000000..60032ed17 --- /dev/null +++ b/bin/ruby-rewrite @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'ruby-rewrite' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("parser", "ruby-rewrite") diff --git a/bin/ruby2gv b/bin/ruby2gv new file mode 100755 index 000000000..3b82be141 --- /dev/null +++ b/bin/ruby2gv @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'ruby2gv' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("ruby-graphviz", "ruby2gv") diff --git a/bin/safe_yaml b/bin/safe_yaml new file mode 100755 index 000000000..5979200f1 --- /dev/null +++ b/bin/safe_yaml @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'safe_yaml' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("safe_yaml", "safe_yaml") diff --git a/bin/sass b/bin/sass new file mode 100755 index 000000000..ef9f699d8 --- /dev/null +++ b/bin/sass @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sass' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sass", "sass") diff --git a/bin/sass-convert b/bin/sass-convert new file mode 100755 index 000000000..13936f1df --- /dev/null +++ b/bin/sass-convert @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sass-convert' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sass", "sass-convert") diff --git a/bin/scss b/bin/scss new file mode 100755 index 000000000..76c0dce5f --- /dev/null +++ b/bin/scss @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'scss' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sass", "scss") diff --git a/bin/sdoc b/bin/sdoc new file mode 100755 index 000000000..6d3dbba68 --- /dev/null +++ b/bin/sdoc @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sdoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sdoc", "sdoc") diff --git a/bin/sdoc-merge b/bin/sdoc-merge new file mode 100755 index 000000000..7e997760e --- /dev/null +++ b/bin/sdoc-merge @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sdoc-merge' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sdoc", "sdoc-merge") diff --git a/bin/sequel b/bin/sequel new file mode 100755 index 000000000..bff4fa333 --- /dev/null +++ b/bin/sequel @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sequel' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sequel", "sequel") diff --git a/bin/sidekiq b/bin/sidekiq new file mode 100755 index 000000000..83aab28f8 --- /dev/null +++ b/bin/sidekiq @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sidekiq' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sidekiq", "sidekiq") diff --git a/bin/sidekiqctl b/bin/sidekiqctl new file mode 100755 index 000000000..7ea23ddee --- /dev/null +++ b/bin/sidekiqctl @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sidekiqctl' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sidekiq", "sidekiqctl") diff --git a/bin/slimrb b/bin/slimrb new file mode 100755 index 000000000..8e106805e --- /dev/null +++ b/bin/slimrb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'slimrb' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("slim", "slimrb") diff --git a/bin/sprockets b/bin/sprockets new file mode 100755 index 000000000..e8ffa4dd9 --- /dev/null +++ b/bin/sprockets @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sprockets' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sprockets", "sprockets") diff --git a/bin/teaspoon b/bin/teaspoon new file mode 100755 index 000000000..db1919810 --- /dev/null +++ b/bin/teaspoon @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'teaspoon' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("teaspoon", "teaspoon") diff --git a/bin/thor b/bin/thor new file mode 100755 index 000000000..63f10e55d --- /dev/null +++ b/bin/thor @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'thor' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("thor", "thor") diff --git a/bin/tilt b/bin/tilt new file mode 100755 index 000000000..a606a2ee5 --- /dev/null +++ b/bin/tilt @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'tilt' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("tilt", "tilt") diff --git a/bin/transpec b/bin/transpec new file mode 100755 index 000000000..be3f396ff --- /dev/null +++ b/bin/transpec @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'transpec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("transpec", "transpec") diff --git a/bin/whenever b/bin/whenever new file mode 100755 index 000000000..80d7387d7 --- /dev/null +++ b/bin/whenever @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'whenever' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("whenever", "whenever") diff --git a/bin/wheneverize b/bin/wheneverize new file mode 100755 index 000000000..783105e92 --- /dev/null +++ b/bin/wheneverize @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'wheneverize' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("whenever", "wheneverize") diff --git a/bin/xml2gv b/bin/xml2gv new file mode 100755 index 000000000..33b47ef4a --- /dev/null +++ b/bin/xml2gv @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'xml2gv' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", +  Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("ruby-graphviz", "xml2gv") diff --git a/db/schema.rb b/db/schema.rb index d71a2def3..cd5fb8627 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -408,9 +408,9 @@ ActiveRecord::Schema.define(version: 20171109101605) do      t.string   "type"      t.integer  "parent_id",             limit: 8      t.string   "parent_type" -    t.datetime "notified_parent_at"      t.integer  "current_step",                    default: 0      t.integer  "total_steps",                     default: 0 +    t.datetime "notified_parent_at"      t.string   "creator"    end diff --git a/spec/factories/line_referentials.rb b/spec/factories/line_referentials.rb index cfce1399f..6db4aab18 100644 --- a/spec/factories/line_referentials.rb +++ b/spec/factories/line_referentials.rb @@ -1,5 +1,6 @@  FactoryGirl.define do    factory :line_referential do      sequence(:name) { |n| "Line Referential #{n}" } +    objectid_format 'netex'    end  end diff --git a/spec/factories/referentials.rb b/spec/factories/referentials.rb index a4155d181..ece48a54e 100644 --- a/spec/factories/referentials.rb +++ b/spec/factories/referentials.rb @@ -8,6 +8,7 @@ FactoryGirl.define do      association :organisation      time_zone "Europe/Paris"      ready { true } +    objectid_format "netex"      factory :workbench_referential do        association :workbench diff --git a/spec/factories/stop_area_referentials.rb b/spec/factories/stop_area_referentials.rb index c88819010..253ef9715 100644 --- a/spec/factories/stop_area_referentials.rb +++ b/spec/factories/stop_area_referentials.rb @@ -1,5 +1,6 @@  FactoryGirl.define do    factory :stop_area_referential, :class => StopAreaReferential do      sequence(:name) { |n| "StopArea Referential #{n}" } +    objectid_format 'netex'    end  end diff --git a/spec/factories/workbenches.rb b/spec/factories/workbenches.rb index 57bef2203..f231fcdeb 100644 --- a/spec/factories/workbenches.rb +++ b/spec/factories/workbenches.rb @@ -1,6 +1,7 @@  FactoryGirl.define do    factory :workbench do      name "Gestion de l'offre" +    objectid_format 'netex'      association :organisation      association :line_referential diff --git a/spec/models/chouette/company_spec.rb b/spec/models/chouette/company_spec.rb index a3101d79c..067501c85 100644 --- a/spec/models/chouette/company_spec.rb +++ b/spec/models/chouette/company_spec.rb @@ -4,6 +4,12 @@ describe Chouette::Company, :type => :model do    subject { create(:company) }    it { should validate_presence_of :name } +  describe "#objectid_format" do +    it "sould not be nil" do +      expect(subject.objectid_format).not_to be_nil +    end +  end +    describe "#nullables empty" do      it "should set null empty nullable attributes" do        subject.organizational_unit = '' diff --git a/spec/models/chouette/journey_pattern_spec.rb b/spec/models/chouette/journey_pattern_spec.rb index 047022ade..d631511a3 100644 --- a/spec/models/chouette/journey_pattern_spec.rb +++ b/spec/models/chouette/journey_pattern_spec.rb @@ -30,6 +30,12 @@ describe Chouette::JourneyPattern, :type => :model do    #   end    # end +  describe "#objectid_format" do +    it "sould not be nil" do +      expect(subject.objectid_format).not_to be_nil +    end +  end +    describe "state_update" do      def journey_pattern_to_state jp        jp.attributes.slice('name', 'published_name', 'registration_number').tap do |item| diff --git a/spec/models/chouette/line_spec.rb b/spec/models/chouette/line_spec.rb index 2e5882012..604a54a9f 100644 --- a/spec/models/chouette/line_spec.rb +++ b/spec/models/chouette/line_spec.rb @@ -20,6 +20,12 @@ describe Chouette::Line, :type => :model do      it { is_expected.to be_kind_of(Chouette::StifCodifligneObjectid) }    end +  describe "#objectid_format" do +    it "sould not be nil" do +      expect(subject.objectid_format).not_to be_nil +    end +  end +    # it { should validate_numericality_of :objectversion }    # describe ".last_stop_areas_parents" do diff --git a/spec/models/chouette/network_spec.rb b/spec/models/chouette/network_spec.rb index 32bacc512..75fc17587 100644 --- a/spec/models/chouette/network_spec.rb +++ b/spec/models/chouette/network_spec.rb @@ -3,6 +3,12 @@ require 'spec_helper'  describe Chouette::Network, :type => :model do    subject { create(:network) }    it { should validate_presence_of :name } +   +  describe "#objectid_format" do +    it "sould not be nil" do +      expect(subject.objectid_format).not_to be_nil +    end +  end    describe "#stop_areas" do      let!(:line){create(:line, :network => subject)} diff --git a/spec/models/chouette/route/route_base_spec.rb b/spec/models/chouette/route/route_base_spec.rb index cac2880e8..7220dcafd 100644 --- a/spec/models/chouette/route/route_base_spec.rb +++ b/spec/models/chouette/route/route_base_spec.rb @@ -10,6 +10,12 @@ RSpec.describe Chouette::Route, :type => :model do      it { is_expected.to be_kind_of(Chouette::StifNetexObjectid) }    end +  describe "#objectid_format" do +    it "sould not be nil" do +      expect(subject.objectid_format).not_to be_nil +    end +  end +    it { is_expected.to enumerize(:direction).in(:straight_forward, :backward, :clockwise, :counter_clockwise, :north, :north_west, :west, :south_west, :south, :south_east, :east, :north_east) }    it { is_expected.to enumerize(:wayback).in(:outbound, :inbound) } diff --git a/spec/models/chouette/routing_constraint_zone_spec.rb b/spec/models/chouette/routing_constraint_zone_spec.rb index c344642e6..32c3410a4 100644 --- a/spec/models/chouette/routing_constraint_zone_spec.rb +++ b/spec/models/chouette/routing_constraint_zone_spec.rb @@ -8,6 +8,12 @@ describe Chouette::RoutingConstraintZone, type: :model do    # shoulda matcher to validate length of array ?    xit { is_expected.to validate_length_of(:stop_point_ids).is_at_least(2) } +  describe "#objectid_format" do +    it "sould not be nil" do +      expect(subject.objectid_format).not_to be_nil +    end +  end +    describe 'checksum' do      it_behaves_like 'checksum support', :routing_constraint_zone    end diff --git a/spec/models/chouette/stop_area_spec.rb b/spec/models/chouette/stop_area_spec.rb index a3a398bfb..d2547b292 100644 --- a/spec/models/chouette/stop_area_spec.rb +++ b/spec/models/chouette/stop_area_spec.rb @@ -12,6 +12,12 @@ describe Chouette::StopArea, :type => :model do      it { should be_kind_of(Chouette::StifReflexObjectid) }    end +  describe "#objectid_format" do +    it "sould not be nil" do +      expect(subject.objectid_format).not_to be_nil +    end +  end +    it { should belong_to(:stop_area_referential) }    it { should validate_presence_of :name }    it { should validate_numericality_of :latitude } diff --git a/spec/models/chouette/stop_point_spec.rb b/spec/models/chouette/stop_point_spec.rb index 329e76a75..52f70c214 100644 --- a/spec/models/chouette/stop_point_spec.rb +++ b/spec/models/chouette/stop_point_spec.rb @@ -13,6 +13,12 @@ describe StopPoint, :type => :model do      it { is_expected.to be_kind_of(Chouette::StifNetexObjectid) }    end +  describe "#objectid_format" do +    it "sould not be nil" do +      expect(subject.objectid_format).not_to be_nil +    end +  end +    describe "#destroy" do      before(:each) do        @vehicle = create(:vehicle_journey) diff --git a/spec/models/chouette/time_table_spec.rb b/spec/models/chouette/time_table_spec.rb index 761c39e5b..74809fa58 100644 --- a/spec/models/chouette/time_table_spec.rb +++ b/spec/models/chouette/time_table_spec.rb @@ -6,6 +6,12 @@ describe Chouette::TimeTable, :type => :model do    it { is_expected.to validate_presence_of :comment }    it { is_expected.to validate_uniqueness_of :objectid } +   +    describe "#objectid_format" do +      it "sould not be nil" do +        expect(subject.objectid_format).not_to be_nil +      end +    end      def create_time_table_periode time_table, start_date, end_date        create(:time_table_period, time_table: time_table, :period_start => start_date, :period_end => end_date) diff --git a/spec/models/chouette/vehicle_journey_spec.rb b/spec/models/chouette/vehicle_journey_spec.rb index 52f2ab42d..d4f3e0204 100644 --- a/spec/models/chouette/vehicle_journey_spec.rb +++ b/spec/models/chouette/vehicle_journey_spec.rb @@ -1,6 +1,13 @@  require 'spec_helper'  describe Chouette::VehicleJourney, :type => :model do + +    describe "#objectid_format" do +      it "sould not be nil" do +        expect(subject.objectid_format).not_to be_nil +      end +    end +    it "must be valid with an at-stop day offset of 1" do      vehicle_journey = create(        :vehicle_journey, diff --git a/spec/models/line_referential_spec.rb b/spec/models/line_referential_spec.rb index 8c6cb018b..ea83c0ebd 100644 --- a/spec/models/line_referential_spec.rb +++ b/spec/models/line_referential_spec.rb @@ -9,6 +9,7 @@ RSpec.describe LineReferential, :type => :model do    it { is_expected.to have_many(:line_referential_syncs) }    it { is_expected.to have_many(:workbenches) }    it { should validate_presence_of(:sync_interval) } +  it { should validate_presence_of(:objectid_format) }    describe "#transport_modes" do      it 'returns a list of all transport modes' do diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb index ad9c43010..987eea30a 100644 --- a/spec/models/referential_spec.rb +++ b/spec/models/referential_spec.rb @@ -12,6 +12,8 @@ describe Referential, :type => :model do    it { should belong_to(:workbench) }    it { should belong_to(:referential_suite) } +  # it { should validate_presence_of(:objectid_format) } +    context ".referential_ids_in_periode" do      it 'should retrieve referential id in periode range' do        range = ref.metadatas.first.periodes.sample diff --git a/spec/models/stop_area_referential_spec.rb b/spec/models/stop_area_referential_spec.rb index 271badff8..dd2bdce20 100644 --- a/spec/models/stop_area_referential_spec.rb +++ b/spec/models/stop_area_referential_spec.rb @@ -7,4 +7,5 @@ RSpec.describe StopAreaReferential, :type => :model do    it { is_expected.to have_many(:stop_area_referential_syncs) }    it { is_expected.to have_many(:workbenches) } +  it { should validate_presence_of(:objectid_format) }  end diff --git a/spec/models/workbench_spec.rb b/spec/models/workbench_spec.rb index 037537b60..3b9ed6b07 100644 --- a/spec/models/workbench_spec.rb +++ b/spec/models/workbench_spec.rb @@ -7,6 +7,7 @@ RSpec.describe Workbench, :type => :model do    it { should validate_presence_of(:name) }    it { should validate_presence_of(:organisation) } +  it { should validate_presence_of(:objectid_format) }    it { should belong_to(:organisation) }    it { should belong_to(:line_referential) } | 
