aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/companies_controller.rb2
-rw-r--r--app/controllers/journey_patterns_collections_controller.rb2
-rw-r--r--app/controllers/lines_controller.rb2
-rw-r--r--app/controllers/networks_controller.rb2
-rw-r--r--app/controllers/referential_lines_controller.rb2
-rw-r--r--app/controllers/routes_controller.rb2
-rw-r--r--app/controllers/routing_constraint_zones_controller.rb2
-rw-r--r--app/controllers/stop_areas_controller.rb2
-rw-r--r--app/controllers/time_tables_controller.rb2
-rw-r--r--app/controllers/vehicle_journeys_controller.rb2
-rw-r--r--app/decorators/company_decorator.rb (renamed from app/decorators/chouette/company_decorator.rb)2
-rw-r--r--app/decorators/line_decorator.rb (renamed from app/decorators/chouette/line_decorator.rb)2
-rw-r--r--app/decorators/network_decorator.rb (renamed from app/decorators/chouette/network_decorator.rb)2
-rw-r--r--app/decorators/route_decorator.rb (renamed from app/decorators/chouette/route_decorator.rb)2
-rw-r--r--app/decorators/routing_constraint_zone_decorator.rb (renamed from app/decorators/chouette/routing_constraint_zone_decorator.rb)2
-rw-r--r--app/decorators/stop_area_decorator.rb (renamed from app/decorators/chouette/stop_area_decorator.rb)2
-rw-r--r--app/decorators/stop_point_decorator.rb (renamed from app/decorators/chouette/stop_point_decorator.rb)4
-rw-r--r--app/decorators/time_table_decorator.rb (renamed from app/decorators/chouette/time_table_decorator.rb)2
-rw-r--r--app/models/chouette.rb5
-rw-r--r--app/models/chouette/active_record.rb4
-rw-r--r--app/models/chouette/stop_point.rb2
-rw-r--r--app/models/chouette/timeband.rb2
-rw-r--r--app/policies/access_link_policy.rb (renamed from app/policies/chouette/access_link_policy.rb)2
-rw-r--r--app/policies/access_point_policy.rb (renamed from app/policies/chouette/access_point_policy.rb)2
-rw-r--r--app/policies/company_policy.rb (renamed from app/policies/chouette/company_policy.rb)2
-rw-r--r--app/policies/connection_link_policy.rb (renamed from app/policies/chouette/connection_link_policy.rb)2
-rw-r--r--app/policies/group_of_line_policy.rb (renamed from app/policies/chouette/group_of_line_policy.rb)2
-rw-r--r--app/policies/journey_pattern_policy.rb (renamed from app/policies/chouette/journey_pattern_policy.rb)2
-rw-r--r--app/policies/line_policy.rb (renamed from app/policies/chouette/line_policy.rb)2
-rw-r--r--app/policies/network_policy.rb (renamed from app/policies/chouette/network_policy.rb)2
-rw-r--r--app/policies/route_policy.rb (renamed from app/policies/chouette/route_policy.rb)2
-rw-r--r--app/policies/routing_constraint_zone_policy.rb (renamed from app/policies/chouette/routing_constraint_zone_policy.rb)2
-rw-r--r--app/policies/stop_area_policy.rb (renamed from app/policies/chouette/stop_area_policy.rb)2
-rw-r--r--app/policies/time_table_policy.rb (renamed from app/policies/chouette/time_table_policy.rb)2
-rw-r--r--app/policies/vehicle_journey_policy.rb (renamed from app/policies/chouette/vehicle_journey_policy.rb)2
-rw-r--r--lib/stif/reflex_synchronization.rb3
-rw-r--r--spec/fabricators/user_fabricator.rb2
-rw-r--r--spec/features/line_footnotes_permissions_spec.rb2
-rw-r--r--spec/features/lines_permissions_spec.rb4
-rw-r--r--spec/features/referential_lines_permissions_spec.rb2
-rw-r--r--spec/features/routes_permissions_spec.rb4
-rw-r--r--spec/features/time_tables_permissions_spec.rb2
-rw-r--r--spec/helpers/table_builder_helper_spec.rb4
-rw-r--r--spec/policies/access_link_policy_spec.rb2
-rw-r--r--spec/policies/access_point_policy_spec.rb2
-rw-r--r--spec/policies/company_policy_spec.rb2
-rw-r--r--spec/policies/connection_link_policy_spec.rb2
-rw-r--r--spec/policies/group_of_line_policy_spec.rb2
-rw-r--r--spec/policies/journey_pattern_policy_spec.rb2
-rw-r--r--spec/policies/line_policy_spec.rb2
-rw-r--r--spec/policies/network_policy_spec.rb2
-rw-r--r--spec/policies/route_policy_spec.rb2
-rw-r--r--spec/policies/routing_constraint_zone_policy_spec.rb2
-rw-r--r--spec/policies/stop_area_policy_spec.rb2
-rw-r--r--spec/policies/time_table_policy_spec.rb2
-rw-r--r--spec/views/routes/show.html.erb_spec.rb2
56 files changed, 47 insertions, 79 deletions
diff --git a/app/controllers/companies_controller.rb b/app/controllers/companies_controller.rb
index ec695bcbf..bc5bedd7f 100644
--- a/app/controllers/companies_controller.rb
+++ b/app/controllers/companies_controller.rb
@@ -77,7 +77,7 @@ class CompaniesController < InheritedResources::Base
def decorate_companies(companies)
ModelDecorator.decorate(
companies,
- with: Chouette::CompanyDecorator,
+ with: CompanyDecorator,
context: {
referential: line_referential
}
diff --git a/app/controllers/journey_patterns_collections_controller.rb b/app/controllers/journey_patterns_collections_controller.rb
index f217dccb3..546158fa8 100644
--- a/app/controllers/journey_patterns_collections_controller.rb
+++ b/app/controllers/journey_patterns_collections_controller.rb
@@ -48,7 +48,7 @@ class JourneyPatternsCollectionsController < ChouetteController
end
def user_permissions
- policy = policy(:"chouette/journey_pattern")
+ policy = policy(:journey_pattern)
@perms =
%w{create destroy update}.inject({}) do | permissions, action |
permissions.merge( "journey_patterns.#{action}" => policy.authorizes_action?(action) )
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb
index 49a8ca2c5..cf2908500 100644
--- a/app/controllers/lines_controller.rb
+++ b/app/controllers/lines_controller.rb
@@ -15,7 +15,7 @@ class LinesController < InheritedResources::Base
index! do |format|
@lines = ModelDecorator.decorate(
@lines,
- with: Chouette::LineDecorator,
+ with: LineDecorator,
context: {
line_referential: @line_referential,
current_organisation: current_organisation
diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb
index d90af0ed8..98c840777 100644
--- a/app/controllers/networks_controller.rb
+++ b/app/controllers/networks_controller.rb
@@ -85,7 +85,7 @@ class NetworksController < InheritedResources::Base
def decorate_networks(networks)
ModelDecorator.decorate(
networks,
- with: Chouette::NetworkDecorator,
+ with: NetworkDecorator,
context: {
line_referential: line_referential
}
diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb
index 75e574da3..b9f8c0050 100644
--- a/app/controllers/referential_lines_controller.rb
+++ b/app/controllers/referential_lines_controller.rb
@@ -29,7 +29,7 @@ class ReferentialLinesController < ChouetteController
@routes = ModelDecorator.decorate(
@routes,
- with: Chouette::RouteDecorator,
+ with: RouteDecorator,
context: {
referential: referential,
line: @line
diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb
index bf3078c59..93f30f4d5 100644
--- a/app/controllers/routes_controller.rb
+++ b/app/controllers/routes_controller.rb
@@ -48,7 +48,7 @@ class RoutesController < ChouetteController
@route_sp = ModelDecorator.decorate(
@route_sp,
- with: Chouette::StopPointDecorator
+ with: StopPointDecorator
)
end
end
diff --git a/app/controllers/routing_constraint_zones_controller.rb b/app/controllers/routing_constraint_zones_controller.rb
index 8261373a6..6c3da5980 100644
--- a/app/controllers/routing_constraint_zones_controller.rb
+++ b/app/controllers/routing_constraint_zones_controller.rb
@@ -14,7 +14,7 @@ class RoutingConstraintZonesController < ChouetteController
index! do |format|
@routing_constraint_zones = ModelDecorator.decorate(
@routing_constraint_zones,
- with: Chouette::RoutingConstraintZoneDecorator,
+ with: RoutingConstraintZoneDecorator,
context: {
referential: referential,
line: parent
diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb
index 2732c5f99..1d6f88068 100644
--- a/app/controllers/stop_areas_controller.rb
+++ b/app/controllers/stop_areas_controller.rb
@@ -56,7 +56,7 @@ class StopAreasController < InheritedResources::Base
@stop_areas = ModelDecorator.decorate(
@stop_areas,
- with: Chouette::StopAreaDecorator
+ with: StopAreaDecorator
)
}
end
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb
index 34b1ca89d..0c1769ad7 100644
--- a/app/controllers/time_tables_controller.rb
+++ b/app/controllers/time_tables_controller.rb
@@ -168,7 +168,7 @@ class TimeTablesController < ChouetteController
def decorate_time_tables(time_tables)
ModelDecorator.decorate(
time_tables,
- with: Chouette::TimeTableDecorator,
+ with: TimeTableDecorator,
context: {
referential: @referential
}
diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb
index e74957ffc..050f2f219 100644
--- a/app/controllers/vehicle_journeys_controller.rb
+++ b/app/controllers/vehicle_journeys_controller.rb
@@ -158,7 +158,7 @@ class VehicleJourneysController < ChouetteController
end
def user_permissions
- policy = policy(:"chouette/vehicle_journey")
+ policy = policy(:vehicle_journey)
@perms =
%w{create destroy update}.inject({}) do | permissions, action |
permissions.merge( "vehicle_journeys.#{action}" => policy.authorizes_action?(action) )
diff --git a/app/decorators/chouette/company_decorator.rb b/app/decorators/company_decorator.rb
index e6353f009..a95f90128 100644
--- a/app/decorators/chouette/company_decorator.rb
+++ b/app/decorators/company_decorator.rb
@@ -1,4 +1,3 @@
-module Chouette
class CompanyDecorator < Draper::Decorator
decorates Chouette::Company
@@ -51,4 +50,3 @@ module Chouette
links
end
end
-end \ No newline at end of file
diff --git a/app/decorators/chouette/line_decorator.rb b/app/decorators/line_decorator.rb
index 3a16dfd94..d465f9321 100644
--- a/app/decorators/chouette/line_decorator.rb
+++ b/app/decorators/line_decorator.rb
@@ -1,4 +1,3 @@
-module Chouette
class LineDecorator < Draper::Decorator
decorates Chouette::Line
@@ -44,4 +43,3 @@ module Chouette
links
end
end
-end \ No newline at end of file
diff --git a/app/decorators/chouette/network_decorator.rb b/app/decorators/network_decorator.rb
index fb6588689..4f22141e0 100644
--- a/app/decorators/chouette/network_decorator.rb
+++ b/app/decorators/network_decorator.rb
@@ -1,4 +1,3 @@
-module Chouette
class NetworkDecorator < Draper::Decorator
decorates Chouette::Network
@@ -43,4 +42,3 @@ module Chouette
links
end
end
-end \ No newline at end of file
diff --git a/app/decorators/chouette/route_decorator.rb b/app/decorators/route_decorator.rb
index 479847f00..ca35c2dde 100644
--- a/app/decorators/chouette/route_decorator.rb
+++ b/app/decorators/route_decorator.rb
@@ -1,4 +1,3 @@
-module Chouette
class RouteDecorator < Draper::Decorator
decorates Chouette::Route
@@ -74,4 +73,3 @@ module Chouette
links
end
end
-end \ No newline at end of file
diff --git a/app/decorators/chouette/routing_constraint_zone_decorator.rb b/app/decorators/routing_constraint_zone_decorator.rb
index bd5ccbf30..1d12cfc25 100644
--- a/app/decorators/chouette/routing_constraint_zone_decorator.rb
+++ b/app/decorators/routing_constraint_zone_decorator.rb
@@ -1,4 +1,3 @@
-module Chouette
class RoutingConstraintZoneDecorator < Draper::Decorator
decorates Chouette::RoutingConstraintZone
@@ -41,4 +40,3 @@ module Chouette
links
end
end
-end \ No newline at end of file
diff --git a/app/decorators/chouette/stop_area_decorator.rb b/app/decorators/stop_area_decorator.rb
index 7525a9a27..c64ecc9e3 100644
--- a/app/decorators/chouette/stop_area_decorator.rb
+++ b/app/decorators/stop_area_decorator.rb
@@ -1,4 +1,3 @@
-module Chouette
class StopAreaDecorator < Draper::Decorator
decorates Chouette::StopArea
@@ -42,4 +41,3 @@ module Chouette
links
end
end
-end \ No newline at end of file
diff --git a/app/decorators/chouette/stop_point_decorator.rb b/app/decorators/stop_point_decorator.rb
index a9be5459c..f87db73e8 100644
--- a/app/decorators/chouette/stop_point_decorator.rb
+++ b/app/decorators/stop_point_decorator.rb
@@ -1,5 +1,4 @@
-module Chouette
- class StopPointDecorator < Chouette::StopAreaDecorator
+ class StopPointDecorator < StopAreaDecorator
decorates Chouette::StopPoint
delegate_all
@@ -8,4 +7,3 @@ module Chouette
super(object.stop_area)
end
end
-end \ No newline at end of file
diff --git a/app/decorators/chouette/time_table_decorator.rb b/app/decorators/time_table_decorator.rb
index 86906cbe4..e2a5a7a97 100644
--- a/app/decorators/chouette/time_table_decorator.rb
+++ b/app/decorators/time_table_decorator.rb
@@ -1,4 +1,3 @@
-module Chouette
class TimeTableDecorator < Draper::Decorator
decorates Chouette::TimeTable
@@ -54,4 +53,3 @@ module Chouette
links
end
end
-end \ No newline at end of file
diff --git a/app/models/chouette.rb b/app/models/chouette.rb
new file mode 100644
index 000000000..fe49300d4
--- /dev/null
+++ b/app/models/chouette.rb
@@ -0,0 +1,5 @@
+module Chouette
+ def self.use_relative_model_naming?
+ true
+ end
+end \ No newline at end of file
diff --git a/app/models/chouette/active_record.rb b/app/models/chouette/active_record.rb
index e12f30266..c2aab9d50 100644
--- a/app/models/chouette/active_record.rb
+++ b/app/models/chouette/active_record.rb
@@ -24,6 +24,10 @@ module Chouette
end
end
+ def self.model_name
+ ActiveModel::Name.new self, Chouette, self.name.demodulize
+ end
+
# TODO: Can we remove this?
# class << self
# alias_method :create_reflection_without_chouette_naming, :create_reflection
diff --git a/app/models/chouette/stop_point.rb b/app/models/chouette/stop_point.rb
index 86be39d70..f4c9b3800 100644
--- a/app/models/chouette/stop_point.rb
+++ b/app/models/chouette/stop_point.rb
@@ -2,7 +2,7 @@ module Chouette
class StopPoint < Chouette::TridentActiveRecord
def self.policy_class
- Chouette::RoutePolicy
+ RoutePolicy
end
include ForBoardingEnumerations
diff --git a/app/models/chouette/timeband.rb b/app/models/chouette/timeband.rb
index da8bc3dea..21c81ab1c 100644
--- a/app/models/chouette/timeband.rb
+++ b/app/models/chouette/timeband.rb
@@ -8,6 +8,8 @@ module Chouette
end
class Timeband < Chouette::TridentActiveRecord
+ include ObjectidSupport
+
self.primary_key = "id"
validates :start_time, :end_time, presence: true
diff --git a/app/policies/chouette/access_link_policy.rb b/app/policies/access_link_policy.rb
index 539262458..2b974ee71 100644
--- a/app/policies/chouette/access_link_policy.rb
+++ b/app/policies/access_link_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class AccessLinkPolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -18,4 +17,3 @@ module Chouette
!archived? && organisation_match? && user.has_permission?('access_links.destroy')
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/access_point_policy.rb b/app/policies/access_point_policy.rb
index 2ecd971cd..368cf14e7 100644
--- a/app/policies/chouette/access_point_policy.rb
+++ b/app/policies/access_point_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class AccessPointPolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -18,4 +17,3 @@ module Chouette
!archived? && organisation_match? && user.has_permission?('access_points.destroy')
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/company_policy.rb b/app/policies/company_policy.rb
index f2167b91e..d29836e07 100644
--- a/app/policies/chouette/company_policy.rb
+++ b/app/policies/company_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class CompanyPolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -6,4 +5,3 @@ module Chouette
end
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/connection_link_policy.rb b/app/policies/connection_link_policy.rb
index ac7b1746a..7cf0b7131 100644
--- a/app/policies/chouette/connection_link_policy.rb
+++ b/app/policies/connection_link_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class ConnectionLinkPolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -18,4 +17,3 @@ module Chouette
!archived? && organisation_match? && user.has_permission?('connection_links.update')
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/group_of_line_policy.rb b/app/policies/group_of_line_policy.rb
index f31107452..60c60184c 100644
--- a/app/policies/chouette/group_of_line_policy.rb
+++ b/app/policies/group_of_line_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class GroupOfLinePolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -6,4 +5,3 @@ module Chouette
end
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/journey_pattern_policy.rb b/app/policies/journey_pattern_policy.rb
index add28e0ca..c0c9218c2 100644
--- a/app/policies/chouette/journey_pattern_policy.rb
+++ b/app/policies/journey_pattern_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class JourneyPatternPolicy < ApplicationPolicy
class Scope < Scope
@@ -19,4 +18,3 @@ module Chouette
!archived? && organisation_match? && user.has_permission?('journey_patterns.update')
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/line_policy.rb b/app/policies/line_policy.rb
index 678191ef7..559f4e2f8 100644
--- a/app/policies/chouette/line_policy.rb
+++ b/app/policies/line_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class LinePolicy < ApplicationPolicy
class Scope < Scope
@@ -22,4 +21,3 @@ module Chouette
def update_footnote? ; edit_footnote? end
def new_footnote? ; create_footnote? end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/network_policy.rb b/app/policies/network_policy.rb
index d792645b7..75105b7f8 100644
--- a/app/policies/chouette/network_policy.rb
+++ b/app/policies/network_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class NetworkPolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -6,4 +5,3 @@ module Chouette
end
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/route_policy.rb b/app/policies/route_policy.rb
index 224d3c09e..b49f7bca7 100644
--- a/app/policies/chouette/route_policy.rb
+++ b/app/policies/route_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class RoutePolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -22,4 +21,3 @@ module Chouette
create?
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/routing_constraint_zone_policy.rb b/app/policies/routing_constraint_zone_policy.rb
index ce08cfde5..6bdc69d5c 100644
--- a/app/policies/chouette/routing_constraint_zone_policy.rb
+++ b/app/policies/routing_constraint_zone_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class RoutingConstraintZonePolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -18,4 +17,3 @@ module Chouette
!archived? && organisation_match? && user.has_permission?('routing_constraint_zones.update')
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/stop_area_policy.rb b/app/policies/stop_area_policy.rb
index 1a34b3753..eaf4efe60 100644
--- a/app/policies/chouette/stop_area_policy.rb
+++ b/app/policies/stop_area_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class StopAreaPolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -6,4 +5,3 @@ module Chouette
end
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/time_table_policy.rb b/app/policies/time_table_policy.rb
index 33a5f541a..4638eabd8 100644
--- a/app/policies/chouette/time_table_policy.rb
+++ b/app/policies/time_table_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class TimeTablePolicy < ApplicationPolicy
class Scope < Scope
@@ -31,4 +30,3 @@ module Chouette
update?
end
end
-end \ No newline at end of file
diff --git a/app/policies/chouette/vehicle_journey_policy.rb b/app/policies/vehicle_journey_policy.rb
index 744c6f8d4..1aa7a812e 100644
--- a/app/policies/chouette/vehicle_journey_policy.rb
+++ b/app/policies/vehicle_journey_policy.rb
@@ -1,4 +1,3 @@
-module Chouette
class VehicleJourneyPolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -18,4 +17,3 @@ module Chouette
!archived? && organisation_match? && user.has_permission?('vehicle_journeys.update')
end
end
-end \ No newline at end of file
diff --git a/lib/stif/reflex_synchronization.rb b/lib/stif/reflex_synchronization.rb
index a3bf3957e..39a92bd1f 100644
--- a/lib/stif/reflex_synchronization.rb
+++ b/lib/stif/reflex_synchronization.rb
@@ -150,9 +150,8 @@ module Stif
end
def create_or_update_stop_area entry
- stop = Chouette::StopArea.find_or_create_by(objectid: entry['id'])
+ stop = Chouette::StopArea.find_or_create_by(objectid: entry['id'], stop_area_referential: self.defaut_referential )
stop.deleted_at = nil
- stop.stop_area_referential = self.defaut_referential
{
:comment => 'Description',
:name => 'Name',
diff --git a/spec/fabricators/user_fabricator.rb b/spec/fabricators/user_fabricator.rb
index 04c1c6279..62eb82d51 100644
--- a/spec/fabricators/user_fabricator.rb
+++ b/spec/fabricators/user_fabricator.rb
@@ -5,4 +5,4 @@ Fabricator :user do
password { 'password' }
username { "#{FFaker::Name.first_name.parameterize}.#{FFaker::Name.last_name.parameterize}" }
-end \ No newline at end of file
+end
diff --git a/spec/features/line_footnotes_permissions_spec.rb b/spec/features/line_footnotes_permissions_spec.rb
index deac8e8fc..62adbfcd5 100644
--- a/spec/features/line_footnotes_permissions_spec.rb
+++ b/spec/features/line_footnotes_permissions_spec.rb
@@ -10,7 +10,7 @@ describe 'Line Footnotes', type: :feature do
describe 'permissions' do
before do
- allow_any_instance_of(Chouette::LinePolicy).to receive(:update_footnote?).and_return permission
+ allow_any_instance_of(LinePolicy).to receive(:update_footnote?).and_return permission
visit path
end
diff --git a/spec/features/lines_permissions_spec.rb b/spec/features/lines_permissions_spec.rb
index 903868fae..5d53d6568 100644
--- a/spec/features/lines_permissions_spec.rb
+++ b/spec/features/lines_permissions_spec.rb
@@ -13,8 +13,8 @@ describe "Lines", :type => :feature do
create :group_of_line
line_referential.lines << line
line_referential.organisations << Organisation.first
- allow_any_instance_of(Chouette::LinePolicy).to receive(:create?).and_return permission
- allow_any_instance_of(Chouette::LinePolicy).to receive(:destroy?).and_return permission
+ allow_any_instance_of(LinePolicy).to receive(:create?).and_return permission
+ allow_any_instance_of(LinePolicy).to receive(:destroy?).and_return permission
visit path
end
diff --git a/spec/features/referential_lines_permissions_spec.rb b/spec/features/referential_lines_permissions_spec.rb
index bedec3d07..0d156f0d6 100644
--- a/spec/features/referential_lines_permissions_spec.rb
+++ b/spec/features/referential_lines_permissions_spec.rb
@@ -7,7 +7,7 @@ describe 'ReferentialLines', type: :feature do
context 'permissions' do
before do
- allow_any_instance_of(Chouette::RoutePolicy).to receive(:create?).and_return permission
+ allow_any_instance_of(RoutePolicy).to receive(:create?).and_return permission
visit path
end
diff --git a/spec/features/routes_permissions_spec.rb b/spec/features/routes_permissions_spec.rb
index 467d8479d..36c13b24a 100644
--- a/spec/features/routes_permissions_spec.rb
+++ b/spec/features/routes_permissions_spec.rb
@@ -11,8 +11,8 @@ describe "Routes", :type => :feature do
describe 'permissions' do
before do
@user.update(organisation: referential.organisation)
- allow_any_instance_of(Chouette::RoutePolicy).to receive(:edit?).and_return permission
- allow_any_instance_of(Chouette::RoutePolicy).to receive(:destroy?).and_return permission
+ allow_any_instance_of(RoutePolicy).to receive(:edit?).and_return permission
+ allow_any_instance_of(RoutePolicy).to receive(:destroy?).and_return permission
visit path
end
diff --git a/spec/features/time_tables_permissions_spec.rb b/spec/features/time_tables_permissions_spec.rb
index 01c7c2ed2..bd94a3aa1 100644
--- a/spec/features/time_tables_permissions_spec.rb
+++ b/spec/features/time_tables_permissions_spec.rb
@@ -8,7 +8,7 @@ describe "TimeTables", :type => :feature do
describe 'permissions' do
before do
- allow_any_instance_of(Chouette::TimeTablePolicy).to receive(:duplicate?).and_return permission
+ allow_any_instance_of(TimeTablePolicy).to receive(:duplicate?).and_return permission
visit path
end
diff --git a/spec/helpers/table_builder_helper_spec.rb b/spec/helpers/table_builder_helper_spec.rb
index a8854bf97..de81a85af 100644
--- a/spec/helpers/table_builder_helper_spec.rb
+++ b/spec/helpers/table_builder_helper_spec.rb
@@ -37,7 +37,7 @@ describe TableBuilderHelper, type: :helper do
referentials = ModelDecorator.decorate(
referentials,
- with: ReferentialDecorator
+ with: Chouette::ReferentialDecorator
)
expected = <<-HTML
@@ -327,7 +327,7 @@ describe TableBuilderHelper, type: :helper do
</thead>
<tbody>
<tr>
- <td>#{company.objectid.local_id}</td>
+ <td>#{company.get_objectid.local_id}</td>
<td title="Voir"><a href="/referentials/#{referential.id}/companies/#{company.id}">#{company.name}</a></td>
<td></td>
<td></td>
diff --git a/spec/policies/access_link_policy_spec.rb b/spec/policies/access_link_policy_spec.rb
index 392ad7f92..6194ae55c 100644
--- a/spec/policies/access_link_policy_spec.rb
+++ b/spec/policies/access_link_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::AccessLinkPolicy, type: :policy do
+RSpec.describe AccessLinkPolicy, type: :policy do
let( :record ){ build_stubbed :access_link }
diff --git a/spec/policies/access_point_policy_spec.rb b/spec/policies/access_point_policy_spec.rb
index 8154b3d24..b6bc46eb4 100644
--- a/spec/policies/access_point_policy_spec.rb
+++ b/spec/policies/access_point_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::AccessPointPolicy, type: :policy do
+RSpec.describe AccessPointPolicy, type: :policy do
let( :record ){ build_stubbed :access_point }
diff --git a/spec/policies/company_policy_spec.rb b/spec/policies/company_policy_spec.rb
index f374e31d2..2d249a2be 100644
--- a/spec/policies/company_policy_spec.rb
+++ b/spec/policies/company_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::CompanyPolicy, type: :policy do
+RSpec.describe CompanyPolicy, type: :policy do
let( :record ){ build_stubbed :company }
before { stub_policy_scope(record) }
diff --git a/spec/policies/connection_link_policy_spec.rb b/spec/policies/connection_link_policy_spec.rb
index 17cfdeb04..23e40abe3 100644
--- a/spec/policies/connection_link_policy_spec.rb
+++ b/spec/policies/connection_link_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::ConnectionLinkPolicy, type: :policy do
+RSpec.describe ConnectionLinkPolicy, type: :policy do
let( :record ){ build_stubbed :connection_link }
diff --git a/spec/policies/group_of_line_policy_spec.rb b/spec/policies/group_of_line_policy_spec.rb
index 7a58a7f0e..29fbb1bfb 100644
--- a/spec/policies/group_of_line_policy_spec.rb
+++ b/spec/policies/group_of_line_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::GroupOfLinePolicy, type: :policy do
+RSpec.describe GroupOfLinePolicy, type: :policy do
let( :record ){ build_stubbed :group_of_line }
before { stub_policy_scope(record) }
diff --git a/spec/policies/journey_pattern_policy_spec.rb b/spec/policies/journey_pattern_policy_spec.rb
index a7de379a2..39f849277 100644
--- a/spec/policies/journey_pattern_policy_spec.rb
+++ b/spec/policies/journey_pattern_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::JourneyPatternPolicy, type: :policy do
+RSpec.describe JourneyPatternPolicy, type: :policy do
let( :record ){ build_stubbed :journey_pattern }
diff --git a/spec/policies/line_policy_spec.rb b/spec/policies/line_policy_spec.rb
index d2248e750..334073506 100644
--- a/spec/policies/line_policy_spec.rb
+++ b/spec/policies/line_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::LinePolicy, type: :policy do
+RSpec.describe LinePolicy, type: :policy do
let( :record ){ build_stubbed :line }
before { stub_policy_scope(record) }
diff --git a/spec/policies/network_policy_spec.rb b/spec/policies/network_policy_spec.rb
index c09546c22..ae4ffa03a 100644
--- a/spec/policies/network_policy_spec.rb
+++ b/spec/policies/network_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::NetworkPolicy, type: :policy do
+RSpec.describe NetworkPolicy, type: :policy do
let( :record ){ build_stubbed :network }
before { stub_policy_scope(record) }
diff --git a/spec/policies/route_policy_spec.rb b/spec/policies/route_policy_spec.rb
index df2e41a89..d7edceaef 100644
--- a/spec/policies/route_policy_spec.rb
+++ b/spec/policies/route_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::RoutePolicy, type: :policy do
+RSpec.describe RoutePolicy, type: :policy do
let( :record ){ build_stubbed :route }
diff --git a/spec/policies/routing_constraint_zone_policy_spec.rb b/spec/policies/routing_constraint_zone_policy_spec.rb
index 903e3671a..2ef15fa95 100644
--- a/spec/policies/routing_constraint_zone_policy_spec.rb
+++ b/spec/policies/routing_constraint_zone_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::RoutingConstraintZonePolicy, type: :policy do
+RSpec.describe RoutingConstraintZonePolicy, type: :policy do
let( :record ){ build_stubbed :routing_constraint_zone }
diff --git a/spec/policies/stop_area_policy_spec.rb b/spec/policies/stop_area_policy_spec.rb
index 1295ecd68..8fe59c8e3 100644
--- a/spec/policies/stop_area_policy_spec.rb
+++ b/spec/policies/stop_area_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::StopAreaPolicy, type: :policy do
+RSpec.describe StopAreaPolicy, type: :policy do
let( :record ){ build_stubbed :stop_area }
before { stub_policy_scope(record) }
diff --git a/spec/policies/time_table_policy_spec.rb b/spec/policies/time_table_policy_spec.rb
index 6f1e13844..dad3c13bc 100644
--- a/spec/policies/time_table_policy_spec.rb
+++ b/spec/policies/time_table_policy_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Chouette::TimeTablePolicy, type: :policy do
+RSpec.describe TimeTablePolicy, type: :policy do
let( :record ){ build_stubbed :time_table }
diff --git a/spec/views/routes/show.html.erb_spec.rb b/spec/views/routes/show.html.erb_spec.rb
index ee917127f..dae8c9ed3 100644
--- a/spec/views/routes/show.html.erb_spec.rb
+++ b/spec/views/routes/show.html.erb_spec.rb
@@ -6,7 +6,7 @@ RSpec.describe "/routes/show", type: :view do
let!(:route_sp) do
assign :route_sp, ModelDecorator.decorate(
route.stop_points,
- with: Chouette::StopPointDecorator
+ with: StopPointDecorator
)
end