tb_cms 1.2.0.beta1 → 1.2.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/admin/menu_items_controller.rb +0 -3
- data/app/controllers/admin/menus_controller.rb +1 -6
- data/app/controllers/admin/pages_controller.rb +3 -7
- data/app/controllers/admin/snippets_controller.rb +0 -4
- data/app/controllers/cms/sitemaps_controller.rb +0 -4
- data/app/controllers/pages_controller.rb +3 -34
- data/app/helpers/cms/application_helper.rb +2 -18
- data/app/models/concerns/cms_deprecated_multisite.rb +21 -0
- data/app/models/spud_menu.rb +3 -3
- data/app/models/spud_page.rb +12 -20
- data/app/models/spud_snippet.rb +2 -3
- data/app/views/admin/menu_items/_form.html.erb +1 -1
- data/app/views/admin/pages/_form.html.erb +1 -1
- data/db/migrate/20121119030136_change_liquid_tags_to_polymorphic.rb +1 -3
- data/db/migrate/20150108162839_remove_site_id_from_cms_tables.rb +12 -0
- data/lib/spud_cms/engine.rb +0 -4
- data/lib/spud_cms/template_parser.rb +2 -30
- data/lib/spud_cms/version.rb +1 -1
- data/spec/{support/authlogic_helper.rb → authlogic_helper.rb} +1 -1
- data/spec/controllers/admin/menu_items_controller_spec.rb +28 -59
- data/spec/controllers/admin/menus_controller_spec.rb +32 -54
- data/spec/controllers/admin/pages_controller_spec.rb +26 -43
- data/spec/controllers/admin/snippets_controller_spec.rb +2 -2
- data/spec/controllers/pages_controller_spec.rb +11 -63
- data/spec/dummy/config/application.rb +5 -0
- data/spec/dummy/config/environments/production.rb +1 -1
- data/spec/dummy/config/environments/test.rb +1 -1
- data/spec/dummy/db/migrate/{20140110051458_create_spud_liquid_tags.tb_core.rb → 20141231214458_create_tb_liquid_spud_liquid_tags.tb_liquid.rb} +2 -2
- data/spec/dummy/db/migrate/{20140110051483_change_liquid_tags_to_polymorphic.tb_cms.rb → 20141231214480_change_liquid_tags_to_polymorphic.tb_cms.rb} +1 -3
- data/spec/dummy/db/migrate/{20140110051484_drop_spud_page_liquid_tags.tb_cms.rb → 20141231214481_drop_spud_page_liquid_tags.tb_cms.rb} +10 -8
- data/spec/dummy/db/migrate/20150108164814_remove_site_id_from_cms_tables.tb_cms.rb +13 -0
- data/spec/dummy/db/schema.rb +85 -93
- data/spec/helpers/cms/application_helper_spec.rb +23 -74
- data/spec/models/spud_menu_item_spec.rb +6 -6
- data/spec/models/spud_page_partial_revision_spec.rb +2 -2
- data/spec/models/spud_page_partial_spec.rb +9 -9
- data/spec/models/spud_page_spec.rb +20 -44
- data/spec/models/spud_snippet_spec.rb +2 -2
- data/spec/rails_helper.rb +72 -0
- data/spec/spec_helper.rb +77 -32
- metadata +104 -142
- data/spec/controllers/cms/sitemaps_controller_spec.rb +0 -41
- /data/spec/dummy/db/migrate/{20140110051449_create_spud_admin_permissions.tb_core.rb → 20141231214446_create_spud_admin_permissions.tb_core.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051450_create_spud_users.tb_core.rb → 20141231214447_create_spud_users.tb_core.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051451_add_time_zone_to_spud_user.tb_core.rb → 20141231214448_add_time_zone_to_spud_user.tb_core.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051452_add_scope_to_spud_admin_permissions.tb_core.rb → 20141231214449_add_scope_to_spud_admin_permissions.tb_core.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051453_create_spud_user_settings.tb_core.rb → 20141231214450_create_spud_user_settings.tb_core.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051454_create_spud_roles.tb_core.rb → 20141231214451_create_spud_roles.tb_core.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051455_create_spud_permissions.tb_core.rb → 20141231214452_create_spud_permissions.tb_core.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051456_create_spud_role_permissions.tb_core.rb → 20141231214453_create_spud_role_permissions.tb_core.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051457_drop_spud_admin_permissions.tb_core.rb → 20141231214454_drop_spud_admin_permissions.tb_core.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051459_create_spud_permalinks.tb_permalinks.rb → 20141231214455_create_spud_permalinks.tb_permalinks.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051460_add_site_id_to_spud_permalinks.tb_permalinks.rb → 20141231214456_add_site_id_to_spud_permalinks.tb_permalinks.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051461_modify_site_id_for_spud_permalinks.tb_permalinks.rb → 20141231214457_modify_site_id_for_spud_permalinks.tb_permalinks.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051462_create_spud_pages.tb_cms.rb → 20141231214459_create_spud_pages.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051463_create_spud_menus.tb_cms.rb → 20141231214460_create_spud_menus.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051464_create_spud_menu_items.tb_cms.rb → 20141231214461_create_spud_menu_items.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051465_create_spud_templates.tb_cms.rb → 20141231214462_create_spud_templates.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051466_create_spud_page_partials.tb_cms.rb → 20141231214463_create_spud_page_partials.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051467_add_visibility_to_spud_pages.tb_cms.rb → 20141231214464_add_visibility_to_spud_pages.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051468_add_menu_name_to_spud_menu_items.tb_cms.rb → 20141231214465_add_menu_name_to_spud_menu_items.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051469_add_use_custom_url_name_to_spud_pages.tb_cms.rb → 20141231214466_add_use_custom_url_name_to_spud_pages.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051470_add_notes_to_spud_pages.tb_cms.rb → 20141231214467_add_notes_to_spud_pages.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051471_add_menu_id_to_spud_menu_items.tb_cms.rb → 20141231214468_add_menu_id_to_spud_menu_items.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051472_add_classes_to_spud_menu_items.tb_cms.rb → 20141231214469_add_classes_to_spud_menu_items.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051473_add_site_id_to_spud_pages.tb_cms.rb → 20141231214470_add_site_id_to_spud_pages.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051474_add_site_id_to_spud_templates.tb_cms.rb → 20141231214471_add_site_id_to_spud_templates.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051475_add_site_id_to_spud_menus.tb_cms.rb → 20141231214472_add_site_id_to_spud_menus.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051476_create_spud_page_partial_revisions.tb_cms.rb → 20141231214473_create_spud_page_partial_revisions.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051477_add_symbol_name_to_spud_page_partials.tb_cms.rb → 20141231214474_add_symbol_name_to_spud_page_partials.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051478_modify_site_id_for_spud_pages.tb_cms.rb → 20141231214475_modify_site_id_for_spud_pages.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051479_add_content_processed_to_spud_page_partials.tb_cms.rb → 20141231214476_add_content_processed_to_spud_page_partials.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051480_add_layout_to_spud_pages.tb_cms.rb → 20141231214477_add_layout_to_spud_pages.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051481_create_spud_page_liquid_tags.tb_cms.rb → 20141231214478_create_spud_page_liquid_tags.tb_cms.rb} +0 -0
- /data/spec/dummy/db/migrate/{20140110051482_create_spud_snippets.tb_cms.rb → 20141231214479_create_spud_snippets.tb_cms.rb} +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
|
3
|
-
describe SpudPage do
|
3
|
+
describe SpudPage, :type => :model do
|
4
4
|
|
5
5
|
it {should have_many(:spud_page_partials)}
|
6
6
|
it {should have_many(:spud_pages)}
|
@@ -12,28 +12,28 @@ describe SpudPage do
|
|
12
12
|
|
13
13
|
it "should require a name" do
|
14
14
|
p = FactoryGirl.build(:spud_page,:name => nil)
|
15
|
-
p.
|
15
|
+
expect(p).to_not be_valid
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should require a unique url_name" do
|
19
19
|
FactoryGirl.create(:spud_page, :url_name => "test", :use_custom_url_name => true)
|
20
20
|
t = FactoryGirl.build(:spud_page, :url_name => "test", :use_custom_url_name => true)
|
21
|
-
t.
|
21
|
+
expect(t).to_not be_valid
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should generate a url_name if taken" do
|
25
25
|
FactoryGirl.create(:spud_page, :name => "test")
|
26
26
|
t = FactoryGirl.build(:spud_page, :name => "test")
|
27
|
-
|
27
|
+
expect {
|
28
28
|
t.valid?
|
29
|
-
}.
|
29
|
+
}.to change(t, :url_name)
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should dependantly destroy page_partials" do
|
33
33
|
t = FactoryGirl.create(:spud_page, :spud_page_partials => [SpudPagePartial.new(:name => "body")])
|
34
|
-
|
34
|
+
expect {
|
35
35
|
t.destroy
|
36
|
-
}.
|
36
|
+
}.to change(SpudPagePartial, :count).from(1).to(0)
|
37
37
|
end
|
38
38
|
|
39
39
|
|
@@ -42,43 +42,25 @@ describe SpudPage do
|
|
42
42
|
describe "scopes" do
|
43
43
|
|
44
44
|
it "should only show published pages" do
|
45
|
-
SpudPage.published_pages.to_sql.
|
45
|
+
expect(SpudPage.published_pages.to_sql).to eq(SpudPage.where(:published => true).to_sql)
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should only show parent pages" do
|
49
|
-
SpudPage.parent_pages.to_sql.
|
49
|
+
expect(SpudPage.parent_pages.to_sql).to eq(SpudPage.where(:spud_page_id => nil).to_sql)
|
50
50
|
end
|
51
51
|
|
52
52
|
it "should only show public pages" do
|
53
|
-
SpudPage.viewable.to_sql.
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should group pages by parent" do
|
57
|
-
parent_page = FactoryGirl.build(:spud_page,:name => "parent")
|
58
|
-
parent_page.save
|
59
|
-
|
60
|
-
page = FactoryGirl.build(:spud_page,:name => "Page 1")
|
61
|
-
page.spud_page = parent_page
|
62
|
-
page.save
|
63
|
-
page2 = FactoryGirl.build(:spud_page,:name => "Page 2")
|
64
|
-
page2.spud_page = parent_page
|
65
|
-
page2.save
|
66
|
-
|
67
|
-
SpudPage.grouped()[parent_page.id].count.should == 2
|
68
|
-
|
69
|
-
|
53
|
+
expect(SpudPage.viewable.to_sql).to eq(SpudPage.where(:visibility => 0).to_sql)
|
70
54
|
end
|
71
55
|
|
72
56
|
it "should return private if visibility is == 1" do
|
73
57
|
parent_page = FactoryGirl.build(:spud_page,:name => "parent",:visibility => 1)
|
74
58
|
|
75
|
-
parent_page.is_private
|
59
|
+
expect(parent_page.is_private?).to eq(true)
|
76
60
|
|
77
61
|
parent_page.visibility = 0
|
78
|
-
parent_page.is_private
|
62
|
+
expect(parent_page.is_private?).to eq(false)
|
79
63
|
end
|
80
|
-
|
81
|
-
|
82
64
|
end
|
83
65
|
|
84
66
|
describe "generate_url_name" do
|
@@ -89,7 +71,7 @@ describe SpudPage do
|
|
89
71
|
t.spud_page = parent_page
|
90
72
|
t.valid?
|
91
73
|
|
92
|
-
t.url_name.
|
74
|
+
expect(t.url_name).to eq('about/test')
|
93
75
|
|
94
76
|
end
|
95
77
|
|
@@ -100,7 +82,7 @@ describe SpudPage do
|
|
100
82
|
page2 = FactoryGirl.build(:spud_page,:name => "testimonials")
|
101
83
|
page2.valid?
|
102
84
|
|
103
|
-
page2.url_name.
|
85
|
+
expect(page2.url_name).to eq('testimonials-1')
|
104
86
|
end
|
105
87
|
|
106
88
|
it "should add a counter to url_name if the url_name was once in use by another page that was renamed" do
|
@@ -112,7 +94,7 @@ describe SpudPage do
|
|
112
94
|
page2 = FactoryGirl.build(:spud_page,:name => "another")
|
113
95
|
page2.valid?
|
114
96
|
|
115
|
-
page2.url_name.
|
97
|
+
expect(page2.url_name).to eq('another-1')
|
116
98
|
end
|
117
99
|
|
118
100
|
it "should destroy historical permalink if a page is renamed back to its previous name" do
|
@@ -126,9 +108,9 @@ describe SpudPage do
|
|
126
108
|
|
127
109
|
basecount = SpudPermalink.count
|
128
110
|
|
129
|
-
|
111
|
+
expect {
|
130
112
|
page.valid?
|
131
|
-
}.
|
113
|
+
}.to change(page.spud_permalinks.where(:url_name => 'permapage'), :count).from(1).to(0)
|
132
114
|
end
|
133
115
|
|
134
116
|
it "should not allow a custom url to be reused by another page" do
|
@@ -137,7 +119,7 @@ describe SpudPage do
|
|
137
119
|
|
138
120
|
page = FactoryGirl.build(:spud_page,:name => "new",:use_custom_url_name => true,:url_name => "original")
|
139
121
|
|
140
|
-
page.valid
|
122
|
+
expect(page.valid?).to eq(false)
|
141
123
|
end
|
142
124
|
|
143
125
|
it "should not allow a custom url to be reused by another page even if it is a historical permalink" do
|
@@ -150,13 +132,7 @@ describe SpudPage do
|
|
150
132
|
page.save
|
151
133
|
page.use_custom_url_name = true
|
152
134
|
page.url_name = 'original'
|
153
|
-
page.valid
|
135
|
+
expect(page.valid?).to eq(false)
|
154
136
|
end
|
155
|
-
|
156
|
-
|
157
137
|
end
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
138
|
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require 'spec_helper'
|
6
|
+
require 'authlogic_helper'
|
7
|
+
require 'rspec/rails'
|
8
|
+
require 'database_cleaner'
|
9
|
+
require 'simplecov'
|
10
|
+
require 'factory_girl_rails'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
SimpleCov.start 'rails'
|
14
|
+
|
15
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
16
|
+
|
17
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
18
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
19
|
+
# run as spec files by default. This means that files in spec/support that end
|
20
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
21
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
22
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
23
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
24
|
+
#
|
25
|
+
# The following line is provided for convenience purposes. It has the downside
|
26
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
27
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
28
|
+
# require only the support files necessary.
|
29
|
+
#
|
30
|
+
# Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
31
|
+
|
32
|
+
# Checks for pending migrations before tests are run.
|
33
|
+
# If you are not using ActiveRecord, you can remove this line.
|
34
|
+
#ActiveRecord::Migration.maintain_test_schema!
|
35
|
+
|
36
|
+
RSpec.configure do |config|
|
37
|
+
config.raise_errors_for_deprecations!
|
38
|
+
config.infer_base_class_for_anonymous_controllers = false
|
39
|
+
|
40
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
41
|
+
# examples within a transaction, remove the following line or assign false
|
42
|
+
# instead of true.
|
43
|
+
config.use_transactional_fixtures = true
|
44
|
+
|
45
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
46
|
+
# based on their file location, for example enabling you to call `get` and
|
47
|
+
# `post` in specs under `spec/controllers`.
|
48
|
+
#
|
49
|
+
# You can disable this behaviour by removing the line below, and instead
|
50
|
+
# explicitly tag your specs with their type, e.g.:
|
51
|
+
#
|
52
|
+
# RSpec.describe UsersController, :type => :controller do
|
53
|
+
# # ...
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# The different available types are documented in the features, such as in
|
57
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
58
|
+
# config.infer_spec_type_from_file_location!
|
59
|
+
|
60
|
+
# Clean the database as needed
|
61
|
+
# https://github.com/DatabaseCleaner/database_cleaner#rspec-example
|
62
|
+
config.before(:suite) do
|
63
|
+
DatabaseCleaner.strategy = :transaction
|
64
|
+
DatabaseCleaner.clean_with(:truncation)
|
65
|
+
end
|
66
|
+
config.around(:each) do |example|
|
67
|
+
DatabaseCleaner.cleaning do
|
68
|
+
example.run
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,40 +1,85 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
+
# assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
24
|
+
# defined using `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
7
31
|
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
require 'mocha'
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
+
# a real object. This is generally recommended, and will default to
|
37
|
+
# `true` in RSpec 4.
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
17
40
|
|
18
|
-
#
|
19
|
-
#
|
20
|
-
|
21
|
-
|
41
|
+
# The settings below are suggested to provide a good initial experience
|
42
|
+
# with RSpec, but feel free to customize to your heart's content.
|
43
|
+
=begin
|
44
|
+
# These two settings work together to allow you to limit a spec run
|
45
|
+
# to individual examples or groups you care about by tagging them with
|
46
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
47
|
+
# get run.
|
48
|
+
config.filter_run :focus
|
49
|
+
config.run_all_when_everything_filtered = true
|
22
50
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
51
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
52
|
+
# For more details, see:
|
53
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
54
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
55
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
56
|
+
config.disable_monkey_patching!
|
27
57
|
|
28
|
-
|
29
|
-
|
30
|
-
|
58
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
59
|
+
# file, and it's useful to allow more verbose output when running an
|
60
|
+
# individual spec file.
|
61
|
+
if config.files_to_run.one?
|
62
|
+
# Use the documentation formatter for detailed output,
|
63
|
+
# unless a formatter has already been configured
|
64
|
+
# (e.g. via a command-line flag).
|
65
|
+
config.default_formatter = 'doc'
|
31
66
|
end
|
32
67
|
|
33
|
-
|
34
|
-
|
35
|
-
|
68
|
+
# Print the 10 slowest examples and example groups at the
|
69
|
+
# end of the spec run, to help surface which specs are running
|
70
|
+
# particularly slow.
|
71
|
+
config.profile_examples = 10
|
36
72
|
|
37
|
-
|
38
|
-
|
39
|
-
|
73
|
+
# Run specs in random order to surface order dependencies. If you find an
|
74
|
+
# order dependency and want to debug it, you can fix the order by providing
|
75
|
+
# the seed, which is printed after each run.
|
76
|
+
# --seed 1234
|
77
|
+
config.order = :random
|
78
|
+
|
79
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
80
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
81
|
+
# test failures related to randomization by passing the same `--seed` value
|
82
|
+
# as the one that triggered the failure.
|
83
|
+
Kernel.srand config.seed
|
84
|
+
=end
|
40
85
|
end
|