we_bridge_rails_engine_nations 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +34 -0
- data/Gemfile.lock +254 -0
- data/LICENSE.txt +21 -0
- data/MIT-LICENSE +20 -0
- data/README.md +41 -0
- data/Rakefile +37 -0
- data/app/assets/javascripts/areas.js +2 -0
- data/app/assets/javascripts/currencies.js +2 -0
- data/app/assets/javascripts/nations.js +2 -0
- data/app/assets/javascripts/regions.js +2 -0
- data/app/assets/stylesheets/areas.css +4 -0
- data/app/assets/stylesheets/currencies.css +4 -0
- data/app/assets/stylesheets/nations.css +4 -0
- data/app/assets/stylesheets/regions.css +4 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/areas_controller.rb +7 -0
- data/app/controllers/currencies_controller.rb +58 -0
- data/app/controllers/nations_controller.rb +7 -0
- data/app/controllers/regions_controller.rb +7 -0
- data/app/helpers/areas_helper.rb +2 -0
- data/app/helpers/currencies_helper.rb +2 -0
- data/app/helpers/nations_helper.rb +2 -0
- data/app/helpers/regions_helper.rb +2 -0
- data/app/mailers/.keep +0 -0
- data/app/models/.keep +0 -0
- data/app/models/area.rb +14 -0
- data/app/models/area_text.rb +7 -0
- data/app/models/currency.rb +26 -0
- data/app/models/currency_nation_map.rb +4 -0
- data/app/models/currency_text.rb +7 -0
- data/app/models/nation.rb +45 -0
- data/app/models/nation_text.rb +7 -0
- data/app/models/region.rb +15 -0
- data/app/models/region_text.rb +7 -0
- data/app/views/.keep +0 -0
- data/app/views/areas/edit.html.builder +1 -0
- data/app/views/areas/index.html.builder +1 -0
- data/app/views/areas/new.html.builder +1 -0
- data/app/views/areas/show.html.builder +1 -0
- data/app/views/currencies/_form.html.builder +14 -0
- data/app/views/currencies/edit.html.builder +7 -0
- data/app/views/currencies/index.html.builder +25 -0
- data/app/views/currencies/new.html.builder +5 -0
- data/app/views/currencies/show.html.builder +8 -0
- data/app/views/nations/edit.html.builder +1 -0
- data/app/views/nations/index.html.builder +1 -0
- data/app/views/nations/new.html.builder +1 -0
- data/app/views/nations/show.html.builder +1 -0
- data/app/views/regions/edit.html.builder +1 -0
- data/app/views/regions/index.html.builder +1 -0
- data/app/views/regions/new.html.builder +1 -0
- data/app/views/regions/show.html.builder +1 -0
- data/bin/console +14 -0
- data/bin/rails +12 -0
- data/bin/setup +7 -0
- data/config/routes.rb +6 -0
- data/db/migrate/20151127040229_create_nations.rb +27 -0
- data/db/migrate/20151127040410_create_regions.rb +19 -0
- data/db/migrate/20151127040435_create_areas.rb +19 -0
- data/db/migrate/20151202041711_create_currencies.rb +28 -0
- data/db/seeds.rb +439 -0
- data/lib/tasks/we_bridge_rails_engine_nations_tasks.rake +4 -0
- data/lib/we_bridge_rails_engine_nations.rb +7 -0
- data/lib/we_bridge_rails_engine_nations/engine.rb +24 -0
- data/lib/we_bridge_rails_engine_nations/version.rb +3 -0
- data/spec/controllers/areas_controller_spec.rb +169 -0
- data/spec/controllers/currencies_controller_spec.rb +159 -0
- data/spec/controllers/nations_controller_spec.rb +169 -0
- data/spec/controllers/regions_controller_spec.rb +169 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +16 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +8 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.builder +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +28 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/provider_settings.rb +2 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/omniauth.yml +63 -0
- data/spec/dummy/config/omniauth.yml.org +63 -0
- data/spec/dummy/config/routes.rb +56 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +221 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +46295 -0
- data/spec/dummy/log/test.log +678 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/3qWp1cfMUMB1L1B8w4KCdPJNoktDLzCgZhyGa-eLd0g.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6VfBYgqqzYcjALfLCOpHzv3E06n_zzoM0lDBI4rnsx0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6vg_COhVhYBSY6arqzRJFOy9-rF95BfYQsFuol_UGuQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Azqp0lWcLN5Iz5BDrWrNLqHomPvFzn6pENzB3pm95wo.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/GYvDs3EBryNSEN-M5uVb3LOFo1oBWq0iDPijDjBVvUs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/H0uxW1DRyYygsm_fv_sMfVycqsGCazsfNJhSZU81CFY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/HcVN18DR0_BmshzEZLPjkeVDruXBZ9iXjboBWmO6Ozw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/JigkThideDLksj6ZrufTx6bLVyJBmNDbaouRbMbZdIA.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/N2BTDMKiaaZ5__Eeqks0aWBzX-5T9Hg0d0015KmSRQo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/NrdOdaS5o4trMDBP6UBqLzFsRrmSPy7XJBBtdwktXqk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +3 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/bUQg5IzV2hJHu0Ua4jOdDcbaLqfzpRqx6-qq9C23sts.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/boUHvgQlz503FXEZntk5rEF6Z0dNUvT4VOQquML62dQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/g5LtU2jYJLiGyWluzwkSuH9dRStTuMGHLO-ivn8wCYE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gOWNSsYT5GN_cqGVL1MK1faY9XglwixonQVkDk9Pkvk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/h-W0KoQGAiH7Sn5Y6HjTaVkoEceKV_LeymnmENnyLYQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/n5wUjw8Ag9zP7pgTsene8E7Lj3RyWbqUaf2apVdzwc0.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/nYdpABG_YyXwDqCH1vBNjh0m2AlewuKD9vT92xFu9Qs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/nrXgDez-J-7C7rQSEpAiK0Xj5rK37sysOLNYmJIsb_Q.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/r_WSE-C4C32WlhZaTBsdC4x3Mf7EQQ93zBA3xOKSw94.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/s7AiRxV9LdOVAylAE38RiKCstOIGXxlkhZ15nV8_GfY.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tXQLPTRHFdkPsB5bF6KRKGiUir3uMwdTnxE0na0vmes.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/vTbuVbqVUHIvOo23rSZvO1yTT8C-98lLVXe_JG_6Pr8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/x22RvUd8k76gbEMX05JmfJaBplbMc2omvEoreS8eAqg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xQIYU3iVajL0UcrfbxTB8PIxGMuRDRvRjmq0ve9-s9U.cache +2 -0
- data/spec/factories/areas.rb +6 -0
- data/spec/factories/currencies.rb +6 -0
- data/spec/factories/nations.rb +6 -0
- data/spec/factories/regions.rb +6 -0
- data/spec/helpers/areas_helper_spec.rb +15 -0
- data/spec/helpers/currencies_helper_spec.rb +15 -0
- data/spec/helpers/nations_helper_spec.rb +15 -0
- data/spec/helpers/regions_helper_spec.rb +15 -0
- data/spec/models/area_spec.rb +5 -0
- data/spec/models/currency_spec.rb +24 -0
- data/spec/models/nation_spec.rb +24 -0
- data/spec/models/region_spec.rb +5 -0
- data/spec/rails_helper.rb +54 -0
- data/spec/routing/areas_routing_spec.rb +39 -0
- data/spec/routing/currencies_routing_spec.rb +39 -0
- data/spec/routing/nations_routing_spec.rb +39 -0
- data/spec/routing/regions_routing_spec.rb +39 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/views/areas/edit.html.builder_spec.rb +14 -0
- data/spec/views/areas/index.html.builder_spec.rb +14 -0
- data/spec/views/areas/new.html.builder_spec.rb +14 -0
- data/spec/views/areas/show.html.builder_spec.rb +11 -0
- data/spec/views/currencies/edit.html.builder_spec.rb +14 -0
- data/spec/views/currencies/index.html.builder_spec.rb +14 -0
- data/spec/views/currencies/new.html.builder_spec.rb +14 -0
- data/spec/views/currencies/show.html.builder_spec.rb +11 -0
- data/spec/views/nations/edit.html.builder_spec.rb +14 -0
- data/spec/views/nations/index.html.builder_spec.rb +14 -0
- data/spec/views/nations/new.html.builder_spec.rb +14 -0
- data/spec/views/nations/show.html.builder_spec.rb +11 -0
- data/spec/views/regions/edit.html.builder_spec.rb +14 -0
- data/spec/views/regions/index.html.builder_spec.rb +14 -0
- data/spec/views/regions/new.html.builder_spec.rb +14 -0
- data/spec/views/regions/show.html.builder_spec.rb +11 -0
- data/spec/we_bridge_rails_engine_nations_spec.rb +7 -0
- data/we_bridge_rails_engine_nations.gemspec +42 -0
- metadata +482 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
2
|
+
ENV['RAILS_ENV'] ||= 'test'
|
|
3
|
+
require File.expand_path('../dummy/config/environment', __FILE__)
|
|
4
|
+
# Prevent database truncation if the environment is production
|
|
5
|
+
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
|
6
|
+
require 'spec_helper'
|
|
7
|
+
require 'rspec/rails'
|
|
8
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
|
9
|
+
|
|
10
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
|
11
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
|
12
|
+
# run as spec files by default. This means that files in spec/support that end
|
|
13
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
|
14
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
|
15
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
|
16
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
|
17
|
+
#
|
|
18
|
+
# The following line is provided for convenience purposes. It has the downside
|
|
19
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
|
20
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
|
21
|
+
# require only the support files necessary.
|
|
22
|
+
#
|
|
23
|
+
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
|
24
|
+
|
|
25
|
+
# Checks for pending migrations before tests are run.
|
|
26
|
+
# If you are not using ActiveRecord, you can remove this line.
|
|
27
|
+
ActiveRecord::Migration.maintain_test_schema!
|
|
28
|
+
|
|
29
|
+
RSpec.configure do |config|
|
|
30
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
|
31
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
32
|
+
|
|
33
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
34
|
+
# examples within a transaction, remove the following line or assign false
|
|
35
|
+
# instead of true.
|
|
36
|
+
config.use_transactional_fixtures = true
|
|
37
|
+
|
|
38
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
|
39
|
+
# based on their file location, for example enabling you to call `get` and
|
|
40
|
+
# `post` in specs under `spec/controllers`.
|
|
41
|
+
#
|
|
42
|
+
# You can disable this behaviour by removing the line below, and instead
|
|
43
|
+
# explicitly tag your specs with their type, e.g.:
|
|
44
|
+
#
|
|
45
|
+
# RSpec.describe UsersController, :type => :controller do
|
|
46
|
+
# # ...
|
|
47
|
+
# end
|
|
48
|
+
#
|
|
49
|
+
# The different available types are documented in the features, such as in
|
|
50
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
|
51
|
+
config.infer_spec_type_from_file_location!
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
ActiveRecord::Migrator.migrations_paths = %w(db/migrate spec/dummy/db/migrate)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require "rails_helper"
|
|
2
|
+
|
|
3
|
+
RSpec.describe AreasController, type: :routing do
|
|
4
|
+
describe "routing" do
|
|
5
|
+
|
|
6
|
+
it "routes to #index" do
|
|
7
|
+
expect(:get => "/areas").to route_to("areas#index")
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "routes to #new" do
|
|
11
|
+
expect(:get => "/areas/new").to route_to("areas#new")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "routes to #show" do
|
|
15
|
+
expect(:get => "/areas/1").to route_to("areas#show", :id => "1")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "routes to #edit" do
|
|
19
|
+
expect(:get => "/areas/1/edit").to route_to("areas#edit", :id => "1")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "routes to #create" do
|
|
23
|
+
expect(:post => "/areas").to route_to("areas#create")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "routes to #update via PUT" do
|
|
27
|
+
expect(:put => "/areas/1").to route_to("areas#update", :id => "1")
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "routes to #update via PATCH" do
|
|
31
|
+
expect(:patch => "/areas/1").to route_to("areas#update", :id => "1")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "routes to #destroy" do
|
|
35
|
+
expect(:delete => "/areas/1").to route_to("areas#destroy", :id => "1")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require "rails_helper"
|
|
2
|
+
|
|
3
|
+
RSpec.describe CurrenciesController, type: :routing do
|
|
4
|
+
describe "routing" do
|
|
5
|
+
|
|
6
|
+
it "routes to #index" do
|
|
7
|
+
expect(:get => "/currencies").to route_to("currencies#index")
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "routes to #new" do
|
|
11
|
+
expect(:get => "/currencies/new").to route_to("currencies#new")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "routes to #show" do
|
|
15
|
+
expect(:get => "/currencies/1").to route_to("currencies#show", :id => "1")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "routes to #edit" do
|
|
19
|
+
expect(:get => "/currencies/1/edit").to route_to("currencies#edit", :id => "1")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "routes to #create" do
|
|
23
|
+
expect(:post => "/currencies").to route_to("currencies#create")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "routes to #update via PUT" do
|
|
27
|
+
expect(:put => "/currencies/1").to route_to("currencies#update", :id => "1")
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "routes to #update via PATCH" do
|
|
31
|
+
expect(:patch => "/currencies/1").to route_to("currencies#update", :id => "1")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "routes to #destroy" do
|
|
35
|
+
expect(:delete => "/currencies/1").to route_to("currencies#destroy", :id => "1")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require "rails_helper"
|
|
2
|
+
|
|
3
|
+
RSpec.describe NationsController, type: :routing do
|
|
4
|
+
describe "routing" do
|
|
5
|
+
|
|
6
|
+
it "routes to #index" do
|
|
7
|
+
expect(:get => "/nations").to route_to("nations#index")
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "routes to #new" do
|
|
11
|
+
expect(:get => "/nations/new").to route_to("nations#new")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "routes to #show" do
|
|
15
|
+
expect(:get => "/nations/1").to route_to("nations#show", :id => "1")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "routes to #edit" do
|
|
19
|
+
expect(:get => "/nations/1/edit").to route_to("nations#edit", :id => "1")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "routes to #create" do
|
|
23
|
+
expect(:post => "/nations").to route_to("nations#create")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "routes to #update via PUT" do
|
|
27
|
+
expect(:put => "/nations/1").to route_to("nations#update", :id => "1")
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "routes to #update via PATCH" do
|
|
31
|
+
expect(:patch => "/nations/1").to route_to("nations#update", :id => "1")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "routes to #destroy" do
|
|
35
|
+
expect(:delete => "/nations/1").to route_to("nations#destroy", :id => "1")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require "rails_helper"
|
|
2
|
+
|
|
3
|
+
RSpec.describe RegionsController, type: :routing do
|
|
4
|
+
describe "routing" do
|
|
5
|
+
|
|
6
|
+
it "routes to #index" do
|
|
7
|
+
expect(:get => "/regions").to route_to("regions#index")
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "routes to #new" do
|
|
11
|
+
expect(:get => "/regions/new").to route_to("regions#new")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "routes to #show" do
|
|
15
|
+
expect(:get => "/regions/1").to route_to("regions#show", :id => "1")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "routes to #edit" do
|
|
19
|
+
expect(:get => "/regions/1/edit").to route_to("regions#edit", :id => "1")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "routes to #create" do
|
|
23
|
+
expect(:post => "/regions").to route_to("regions#create")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "routes to #update via PUT" do
|
|
27
|
+
expect(:put => "/regions/1").to route_to("regions#update", :id => "1")
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "routes to #update via PATCH" do
|
|
31
|
+
expect(:patch => "/regions/1").to route_to("regions#update", :id => "1")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "routes to #destroy" do
|
|
35
|
+
expect(:delete => "/regions/1").to route_to("regions#destroy", :id => "1")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe "areas/edit", type: :view do
|
|
4
|
+
before(:each) do
|
|
5
|
+
@record = assign(:record, Area.create!(name: 'Asia'))
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "renders the edit area form" do
|
|
9
|
+
render
|
|
10
|
+
|
|
11
|
+
assert_select "form[action=?][method=?]", area_path(@record), "post" do
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe "areas/new", type: :view do
|
|
4
|
+
before(:each) do
|
|
5
|
+
assign(:area, Area.new())
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "renders new area form" do
|
|
9
|
+
render
|
|
10
|
+
|
|
11
|
+
assert_select "form[action=?][method=?]", areas_path, "post" do
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe "currencies/edit", type: :view do
|
|
4
|
+
before(:each) do
|
|
5
|
+
@currency = assign(:currency, Currency.create!())
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "renders the edit currency form" do
|
|
9
|
+
render
|
|
10
|
+
|
|
11
|
+
assert_select "form[action=?][method=?]", currency_path(@currency), "post" do
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe "currencies/new", type: :view do
|
|
4
|
+
before(:each) do
|
|
5
|
+
assign(:currency, Currency.new())
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "renders new currency form" do
|
|
9
|
+
render
|
|
10
|
+
|
|
11
|
+
assert_select "form[action=?][method=?]", currencies_path, "post" do
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe "nations/edit", type: :view do
|
|
4
|
+
before(:each) do
|
|
5
|
+
@record = assign(:record, Nation.create!(name: 'Japan'))
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "renders the edit nation form" do
|
|
9
|
+
render
|
|
10
|
+
|
|
11
|
+
assert_select "form[action=?][method=?]", nation_path(@record), "post" do
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe "nations/new", type: :view do
|
|
4
|
+
before(:each) do
|
|
5
|
+
assign(:record, Nation.new(name: 'Japan'))
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "renders new nation form" do
|
|
9
|
+
render
|
|
10
|
+
|
|
11
|
+
assert_select "form[action=?][method=?]", nations_path, "post" do
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe "regions/edit", type: :view do
|
|
4
|
+
before(:each) do
|
|
5
|
+
@record = assign(:record, Region.create!(name: 'East Asia'))
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "renders the edit region form" do
|
|
9
|
+
render
|
|
10
|
+
|
|
11
|
+
assert_select "form[action=?][method=?]", region_path(@record), "post" do
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe "regions/index", type: :view do
|
|
4
|
+
before(:each) do
|
|
5
|
+
assign(:records, [
|
|
6
|
+
Region.create!(name: 'East Asia'),
|
|
7
|
+
Region.create!(name: 'West Europe')
|
|
8
|
+
])
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it "renders a list of regions" do
|
|
12
|
+
render
|
|
13
|
+
end
|
|
14
|
+
end
|