active_admin-sortable_tree 0.1.0 → 0.2.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 +4 -4
- data/Changelog.md +12 -1
- data/lib/active_admin/sortable_tree/version.rb +1 -1
- metadata +2 -64
- data/.gitignore +0 -11
- data/.travis.yml +0 -9
- data/Gemfile +0 -10
- data/Rakefile +0 -59
- data/active_admin-sortable_tree.gemspec +0 -30
- data/bin/rails +0 -11
- data/gemfiles/3.2.gemfile +0 -7
- data/gemfiles/4.0.gemfile +0 -10
- data/gemfiles/4.1.gemfile +0 -10
- data/script/rails +0 -11
- data/spec/dummy/README.rdoc +0 -261
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/admin/category.rb +0 -15
- data/spec/dummy/app/admin/category_sort_disabled.rb +0 -15
- data/spec/dummy/app/admin/category_tree.rb +0 -9
- data/spec/dummy/app/admin/dashboard.rb +0 -5
- data/spec/dummy/app/assets/javascripts/active_admin.js +0 -2
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/javascripts/jquery.simulate.js +0 -314
- data/spec/dummy/app/assets/stylesheets/active_admin.css.scss +0 -17
- data/spec/dummy/app/assets/stylesheets/application.css +0 -13
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/admin_user.rb +0 -6
- data/spec/dummy/app/models/category.rb +0 -4
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/config/application.rb +0 -56
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -28
- data/spec/dummy/config/environments/production.rb +0 -64
- data/spec/dummy/config/environments/test.rb +0 -32
- data/spec/dummy/config/initializers/active_admin.rb +0 -231
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/devise.rb +0 -256
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -8
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/devise.en.yml +0 -59
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -61
- data/spec/dummy/db/migrate/20140806024135_devise_create_admin_users.rb +0 -48
- data/spec/dummy/db/migrate/20140806024139_create_active_admin_comments.rb +0 -19
- data/spec/dummy/db/migrate/20140806032156_create_categories.rb +0 -12
- data/spec/dummy/db/schema.rb +0 -58
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -25
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/features/sortable_spec.rb +0 -96
- data/spec/rails_helper.rb +0 -65
- data/spec/spec_helper.rb +0 -58
- data/spec/support/wait_for_ajax.rb +0 -19
@@ -1,48 +0,0 @@
|
|
1
|
-
class DeviseCreateAdminUsers < ActiveRecord::Migration
|
2
|
-
def migrate(direction)
|
3
|
-
super
|
4
|
-
# Create a default user
|
5
|
-
AdminUser.create!(:email => 'admin@example.com', :password => 'password', :password_confirmation => 'password') if direction == :up
|
6
|
-
end
|
7
|
-
|
8
|
-
def change
|
9
|
-
create_table(:admin_users) do |t|
|
10
|
-
## Database authenticatable
|
11
|
-
t.string :email, null: false, default: ""
|
12
|
-
t.string :encrypted_password, null: false, default: ""
|
13
|
-
|
14
|
-
## Recoverable
|
15
|
-
t.string :reset_password_token
|
16
|
-
t.datetime :reset_password_sent_at
|
17
|
-
|
18
|
-
## Rememberable
|
19
|
-
t.datetime :remember_created_at
|
20
|
-
|
21
|
-
## Trackable
|
22
|
-
t.integer :sign_in_count, default: 0, null: false
|
23
|
-
t.datetime :current_sign_in_at
|
24
|
-
t.datetime :last_sign_in_at
|
25
|
-
t.string :current_sign_in_ip
|
26
|
-
t.string :last_sign_in_ip
|
27
|
-
|
28
|
-
## Confirmable
|
29
|
-
# t.string :confirmation_token
|
30
|
-
# t.datetime :confirmed_at
|
31
|
-
# t.datetime :confirmation_sent_at
|
32
|
-
# t.string :unconfirmed_email # Only if using reconfirmable
|
33
|
-
|
34
|
-
## Lockable
|
35
|
-
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
36
|
-
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
37
|
-
# t.datetime :locked_at
|
38
|
-
|
39
|
-
|
40
|
-
t.timestamps
|
41
|
-
end
|
42
|
-
|
43
|
-
add_index :admin_users, :email, unique: true
|
44
|
-
add_index :admin_users, :reset_password_token, unique: true
|
45
|
-
# add_index :admin_users, :confirmation_token, unique: true
|
46
|
-
# add_index :admin_users, :unlock_token, unique: true
|
47
|
-
end
|
48
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class CreateActiveAdminComments < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :active_admin_comments do |t|
|
4
|
-
t.string :namespace
|
5
|
-
t.text :body
|
6
|
-
t.string :resource_id, :null => false
|
7
|
-
t.string :resource_type, :null => false
|
8
|
-
t.references :author, :polymorphic => true
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
add_index :active_admin_comments, [:namespace]
|
12
|
-
add_index :active_admin_comments, [:author_type, :author_id]
|
13
|
-
add_index :active_admin_comments, [:resource_type, :resource_id]
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.down
|
17
|
-
drop_table :active_admin_comments
|
18
|
-
end
|
19
|
-
end
|
data/spec/dummy/db/schema.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# This file is auto-generated from the current state of the database. Instead
|
3
|
-
# of editing this file, please use the migrations feature of Active Record to
|
4
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
-
#
|
6
|
-
# Note that this schema.rb definition is the authoritative source for your
|
7
|
-
# database schema. If you need to create the application database on another
|
8
|
-
# system, you should be using db:schema:load, not running all the migrations
|
9
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
-
#
|
12
|
-
# It's strongly recommended to check this file into your version control system.
|
13
|
-
|
14
|
-
ActiveRecord::Schema.define(:version => 20140806032156) do
|
15
|
-
|
16
|
-
create_table "active_admin_comments", :force => true do |t|
|
17
|
-
t.string "namespace"
|
18
|
-
t.text "body"
|
19
|
-
t.string "resource_id", :null => false
|
20
|
-
t.string "resource_type", :null => false
|
21
|
-
t.integer "author_id"
|
22
|
-
t.string "author_type"
|
23
|
-
t.datetime "created_at", :null => false
|
24
|
-
t.datetime "updated_at", :null => false
|
25
|
-
end
|
26
|
-
|
27
|
-
add_index "active_admin_comments", ["author_type", "author_id"], :name => "index_active_admin_comments_on_author_type_and_author_id"
|
28
|
-
add_index "active_admin_comments", ["namespace"], :name => "index_active_admin_comments_on_namespace"
|
29
|
-
add_index "active_admin_comments", ["resource_type", "resource_id"], :name => "index_active_admin_comments_on_resource_type_and_resource_id"
|
30
|
-
|
31
|
-
create_table "admin_users", :force => true do |t|
|
32
|
-
t.string "email", :default => "", :null => false
|
33
|
-
t.string "encrypted_password", :default => "", :null => false
|
34
|
-
t.string "reset_password_token"
|
35
|
-
t.datetime "reset_password_sent_at"
|
36
|
-
t.datetime "remember_created_at"
|
37
|
-
t.integer "sign_in_count", :default => 0, :null => false
|
38
|
-
t.datetime "current_sign_in_at"
|
39
|
-
t.datetime "last_sign_in_at"
|
40
|
-
t.string "current_sign_in_ip"
|
41
|
-
t.string "last_sign_in_ip"
|
42
|
-
t.datetime "created_at", :null => false
|
43
|
-
t.datetime "updated_at", :null => false
|
44
|
-
end
|
45
|
-
|
46
|
-
add_index "admin_users", ["email"], :name => "index_admin_users_on_email", :unique => true
|
47
|
-
add_index "admin_users", ["reset_password_token"], :name => "index_admin_users_on_reset_password_token", :unique => true
|
48
|
-
|
49
|
-
create_table "categories", :force => true do |t|
|
50
|
-
t.string "name"
|
51
|
-
t.string "ancestry"
|
52
|
-
t.string "description"
|
53
|
-
t.integer "position"
|
54
|
-
t.datetime "created_at", :null => false
|
55
|
-
t.datetime "updated_at", :null => false
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
File without changes
|
data/spec/dummy/log/.gitkeep
DELETED
File without changes
|
data/spec/dummy/public/404.html
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
-
div.dialog {
|
8
|
-
width: 25em;
|
9
|
-
padding: 0 4em;
|
10
|
-
margin: 4em auto 0 auto;
|
11
|
-
border: 1px solid #ccc;
|
12
|
-
border-right-color: #999;
|
13
|
-
border-bottom-color: #999;
|
14
|
-
}
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
|
19
|
-
<body>
|
20
|
-
<!-- This file lives in public/404.html -->
|
21
|
-
<div class="dialog">
|
22
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
-
</div>
|
25
|
-
</body>
|
26
|
-
</html>
|
data/spec/dummy/public/422.html
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
-
div.dialog {
|
8
|
-
width: 25em;
|
9
|
-
padding: 0 4em;
|
10
|
-
margin: 4em auto 0 auto;
|
11
|
-
border: 1px solid #ccc;
|
12
|
-
border-right-color: #999;
|
13
|
-
border-bottom-color: #999;
|
14
|
-
}
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
|
19
|
-
<body>
|
20
|
-
<!-- This file lives in public/422.html -->
|
21
|
-
<div class="dialog">
|
22
|
-
<h1>The change you wanted was rejected.</h1>
|
23
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
-
</div>
|
25
|
-
</body>
|
26
|
-
</html>
|
data/spec/dummy/public/500.html
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
-
div.dialog {
|
8
|
-
width: 25em;
|
9
|
-
padding: 0 4em;
|
10
|
-
margin: 4em auto 0 auto;
|
11
|
-
border: 1px solid #ccc;
|
12
|
-
border-right-color: #999;
|
13
|
-
border-bottom-color: #999;
|
14
|
-
}
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
|
19
|
-
<body>
|
20
|
-
<!-- This file lives in public/500.html -->
|
21
|
-
<div class="dialog">
|
22
|
-
<h1>We're sorry, but something went wrong.</h1>
|
23
|
-
</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
File without changes
|
data/spec/dummy/script/rails
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
6
|
-
require 'rails/commands'
|
@@ -1,96 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe "ActiveAdmin::SortableTree", type: :feature do
|
4
|
-
context "configured as sortable" do
|
5
|
-
it "sorts by dragging vertically", js: true do
|
6
|
-
bottom = Category.create! name: "bottom", position: 0
|
7
|
-
top = Category.create! name: "top", position: 1
|
8
|
-
middle = Category.create! name: "middle", position: 2
|
9
|
-
|
10
|
-
visit admin_categories_path
|
11
|
-
|
12
|
-
expect(all(".ui-sortable li h3").map(&:text)).to eq(["bottom", "top", "middle"])
|
13
|
-
|
14
|
-
wait_for_ajax { drag_element("#category_#{middle.id} h3", dy: -100) }
|
15
|
-
wait_for_ajax { drag_element("#category_#{top.id} h3", dy: -100) }
|
16
|
-
|
17
|
-
expect(all(".ui-sortable li h3").map(&:text)).to eq(["top", "middle", "bottom"])
|
18
|
-
expect(Category.order(:position).map(&:name)).to eq(["top", "middle", "bottom"])
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
context "configured as sortable tree" do
|
23
|
-
it "sorts by dragging vertically", js: true do
|
24
|
-
bottom = Category.create! name: "bottom", position: 0
|
25
|
-
top = Category.create! name: "top", position: 1
|
26
|
-
middle = Category.create! name: "middle", position: 2
|
27
|
-
|
28
|
-
visit admin_category_trees_path
|
29
|
-
|
30
|
-
expect(all(".ui-sortable li h3").map(&:text)).to eq(["bottom", "top", "middle"])
|
31
|
-
|
32
|
-
wait_for_ajax { drag_element("#category_tree_#{middle.id} h3", dy: -100) }
|
33
|
-
wait_for_ajax { drag_element("#category_tree_#{top.id} h3", dy: -100) }
|
34
|
-
|
35
|
-
expect(all(".ui-sortable li h3").map(&:text)).to eq(["top", "middle", "bottom"])
|
36
|
-
expect(Category.order(:position).map(&:name)).to eq(["top", "middle", "bottom"])
|
37
|
-
end
|
38
|
-
|
39
|
-
it "assigns hierarchy by dragging horizontally", js: true do
|
40
|
-
top = Category.create! name: "top", position: 0
|
41
|
-
middle = Category.create! name: "middle", position: 1
|
42
|
-
bottom = Category.create! name: "bottom", position: 2
|
43
|
-
expect(top.children).not_to include(middle)
|
44
|
-
|
45
|
-
visit admin_category_trees_path
|
46
|
-
|
47
|
-
wait_for_ajax { drag_element("#category_tree_#{middle.id} h3", dx: 40) }
|
48
|
-
wait_for_ajax { drag_element("#category_tree_#{bottom.id} h3", dx: 40) }
|
49
|
-
|
50
|
-
expect(top.children).to include(middle, bottom)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
context "with option `sortable: false`" do
|
55
|
-
it "disables sorting by excluding sortable data attributes" do
|
56
|
-
bottom = Category.create! name: "bottom", position: 0
|
57
|
-
top = Category.create! name: "top", position: 1
|
58
|
-
middle = Category.create! name: "middle", position: 2
|
59
|
-
|
60
|
-
visit admin_category_disabled_sorts_path
|
61
|
-
|
62
|
-
expect(page).to have_css(".index_as_sortable")
|
63
|
-
expect(page).not_to have_css("[data-sortable-type]")
|
64
|
-
expect(page).not_to have_css("[data-sortable-url]")
|
65
|
-
end
|
66
|
-
|
67
|
-
context "with a proc returning false as sortable option" do
|
68
|
-
it "disables sorting" do
|
69
|
-
proc_evaluated_within_controller = false
|
70
|
-
|
71
|
-
sortable_options_for("CategoryDisabledSort")[:sortable] = proc do
|
72
|
-
proc_evaluated_within_controller = self.is_a?(ActiveAdmin::ResourceController)
|
73
|
-
false
|
74
|
-
end
|
75
|
-
|
76
|
-
bottom = Category.create! name: "bottom", position: 0
|
77
|
-
|
78
|
-
visit admin_category_disabled_sorts_path
|
79
|
-
|
80
|
-
expect(page).to have_css(".index_as_sortable")
|
81
|
-
expect(page).not_to have_css("[data-sortable-type]")
|
82
|
-
expect(proc_evaluated_within_controller).to be true
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def drag_element(selector, options)
|
88
|
-
options.reverse_merge! moves: 20
|
89
|
-
page.execute_script(%Q($("#{selector}").simulate("drag", #{options.to_json} )))
|
90
|
-
end
|
91
|
-
|
92
|
-
def sortable_options_for(resource)
|
93
|
-
resource_config = ActiveAdmin.application.namespace(:admin).resource_for(resource)
|
94
|
-
resource_config.dsl.sortable_options
|
95
|
-
end
|
96
|
-
end
|
data/spec/rails_helper.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
-
ENV["RAILS_ENV"] ||= 'test'
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
require File.expand_path('../dummy/config/environment', __FILE__)
|
6
|
-
|
7
|
-
require 'rspec/rails'
|
8
|
-
require 'capybara/rails'
|
9
|
-
require 'phantomjs/poltergeist'
|
10
|
-
require 'database_cleaner'
|
11
|
-
|
12
|
-
Capybara.javascript_driver = :poltergeist
|
13
|
-
|
14
|
-
def reload_menus!
|
15
|
-
ActiveAdmin.application.namespaces.values.each{|n| n.reset_menu! }
|
16
|
-
end
|
17
|
-
|
18
|
-
def reload_routes!
|
19
|
-
Rails.application.reload_routes!
|
20
|
-
end
|
21
|
-
|
22
|
-
# Setup ActiveAdmin
|
23
|
-
ActiveAdmin.application.load_paths = [File.expand_path("../dummy/app/admin", __FILE__)]
|
24
|
-
ActiveAdmin.unload!
|
25
|
-
ActiveAdmin.load!
|
26
|
-
reload_menus!
|
27
|
-
reload_routes!
|
28
|
-
|
29
|
-
# Disabling authentication in specs so that we don't have to worry about
|
30
|
-
# it allover the place
|
31
|
-
ActiveAdmin.application.authentication_method = false
|
32
|
-
ActiveAdmin.application.current_user_method = false
|
33
|
-
|
34
|
-
Dir[File.expand_path("../support/**/*.rb", __FILE__)].each { |f| require f }
|
35
|
-
|
36
|
-
RSpec.configure do |config|
|
37
|
-
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
38
|
-
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
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 = false
|
44
|
-
|
45
|
-
config.before(:each) do
|
46
|
-
DatabaseCleaner.strategy = :transaction
|
47
|
-
end
|
48
|
-
|
49
|
-
config.before(:each, js: true) do
|
50
|
-
DatabaseCleaner.strategy = :truncation
|
51
|
-
end
|
52
|
-
|
53
|
-
config.before(:each) do
|
54
|
-
DatabaseCleaner.start
|
55
|
-
end
|
56
|
-
|
57
|
-
config.after(:each) do
|
58
|
-
DatabaseCleaner.clean
|
59
|
-
end
|
60
|
-
|
61
|
-
config.infer_spec_type_from_file_location!
|
62
|
-
|
63
|
-
config.include Devise::TestHelpers, type: :controller
|
64
|
-
config.include WaitForAjax, type: :feature
|
65
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
RSpec.configure do |config|
|
2
|
-
# These two settings work together to allow you to limit a spec run
|
3
|
-
# to individual examples or groups you care about by tagging them with
|
4
|
-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
5
|
-
# get run.
|
6
|
-
config.filter_run :focus
|
7
|
-
config.run_all_when_everything_filtered = true
|
8
|
-
|
9
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
10
|
-
# file, and it's useful to allow more verbose output when running an
|
11
|
-
# individual spec file.
|
12
|
-
if config.files_to_run.one?
|
13
|
-
# Use the documentation formatter for detailed output,
|
14
|
-
# unless a formatter has already been configured
|
15
|
-
# (e.g. via a command-line flag).
|
16
|
-
config.default_formatter = 'doc'
|
17
|
-
end
|
18
|
-
|
19
|
-
# Print the 10 slowest examples and example groups at the
|
20
|
-
# end of the spec run, to help surface which specs are running
|
21
|
-
# particularly slow.
|
22
|
-
config.profile_examples = 10
|
23
|
-
|
24
|
-
# Run specs in random order to surface order dependencies. If you find an
|
25
|
-
# order dependency and want to debug it, you can fix the order by providing
|
26
|
-
# the seed, which is printed after each run.
|
27
|
-
# --seed 1234
|
28
|
-
config.order = :random
|
29
|
-
|
30
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
31
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
32
|
-
# test failures related to randomization by passing the same `--seed` value
|
33
|
-
# as the one that triggered the failure.
|
34
|
-
Kernel.srand config.seed
|
35
|
-
|
36
|
-
# rspec-expectations config goes here. You can use an alternate
|
37
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
38
|
-
# assertions if you prefer.
|
39
|
-
config.expect_with :rspec do |expectations|
|
40
|
-
# Enable only the newer, non-monkey-patching expect syntax.
|
41
|
-
# For more details, see:
|
42
|
-
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
43
|
-
expectations.syntax = :expect
|
44
|
-
end
|
45
|
-
|
46
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
47
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
48
|
-
config.mock_with :rspec do |mocks|
|
49
|
-
# Enable only the newer, non-monkey-patching expect syntax.
|
50
|
-
# For more details, see:
|
51
|
-
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
52
|
-
mocks.syntax = :expect
|
53
|
-
|
54
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
55
|
-
# a real object. This is generally recommended.
|
56
|
-
mocks.verify_partial_doubles = true
|
57
|
-
end
|
58
|
-
end
|