rows_controller 1.1.6 → 1.1.7
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/.travis.yml +2 -2
- data/Gemfile +4 -4
- data/Gemfile.lock +84 -77
- data/SNIPPETS +3 -0
- data/lib/rows_controller/version.rb +1 -1
- data/rows_controller.gemspec +5 -5
- data/spec/controllers/orders_spec.rb +29 -29
- data/spec/controllers/rows_spec.rb +1 -1
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/controllers/application_controller.rb +3 -1
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +2 -7
- data/spec/dummy/config/boot.rb +1 -2
- data/spec/dummy/config/environment.rb +1 -1
- data/spec/dummy/config/environments/development.rb +10 -2
- data/spec/dummy/config/environments/production.rb +7 -9
- data/spec/dummy/config/environments/test.rb +5 -2
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +1 -1
- data/spec/dummy/config/secrets.yml +10 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/features/order_spec.rb +12 -12
- data/spec/models/order_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- metadata +8 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f460bf2783c8ab4cbe64c5eb9cba445a7d972dbd
|
|
4
|
+
data.tar.gz: 4bfef7f9bb952b3623af6a8af64f9e6ef3c838ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a18a6e7281447f42d2ef4e51cfc2cb999366fa8ac6ef65f7d4539aa766c71f2a2908aad7c66e1baee729e0c341ccb62ead22eb9307fe90a81c924f5bd1a05e8
|
|
7
|
+
data.tar.gz: e8a45493a8eb0d713213d79bf1e1b49d3cecba930e25fe22fb53ecded93c725edf9943478bda97ad095be006ae597cf34a55e39db8a8833b26c0706fb1022d0e
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
source "https://rubygems.org"
|
|
2
|
-
##gemspec
|
|
3
2
|
|
|
4
3
|
version = ENV["RAILS_VERSION"]
|
|
5
|
-
gem 'rails', version ? "~> #{version}" :
|
|
4
|
+
gem 'rails', version ? "~> #{version}" : '>= 4.1'
|
|
6
5
|
|
|
7
6
|
gem 'slim'
|
|
8
7
|
|
|
9
8
|
group :test do
|
|
10
9
|
gem 'capybara'
|
|
11
|
-
gem 'rspec-rails'
|
|
10
|
+
gem 'rspec-rails', '>= 3.1'
|
|
12
11
|
end
|
|
13
12
|
|
|
14
13
|
group :development, :test do
|
|
@@ -16,5 +15,6 @@ group :development, :test do
|
|
|
16
15
|
gem 'watchr'
|
|
17
16
|
gem 'spork'
|
|
18
17
|
gem 'simplecov', require: false
|
|
19
|
-
gem 'gem-release'
|
|
20
18
|
end
|
|
19
|
+
|
|
20
|
+
gemspec
|
data/Gemfile.lock
CHANGED
|
@@ -1,112 +1,119 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
rows_controller (1.1.7)
|
|
5
|
+
|
|
1
6
|
GEM
|
|
2
7
|
remote: https://rubygems.org/
|
|
3
8
|
specs:
|
|
4
|
-
actionmailer (4.
|
|
5
|
-
actionpack (= 4.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
actionmailer (4.1.6)
|
|
10
|
+
actionpack (= 4.1.6)
|
|
11
|
+
actionview (= 4.1.6)
|
|
12
|
+
mail (~> 2.5, >= 2.5.4)
|
|
13
|
+
actionpack (4.1.6)
|
|
14
|
+
actionview (= 4.1.6)
|
|
15
|
+
activesupport (= 4.1.6)
|
|
11
16
|
rack (~> 1.5.2)
|
|
12
17
|
rack-test (~> 0.6.2)
|
|
13
|
-
|
|
14
|
-
activesupport (= 4.
|
|
15
|
-
builder (~> 3.1
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
actionview (4.1.6)
|
|
19
|
+
activesupport (= 4.1.6)
|
|
20
|
+
builder (~> 3.1)
|
|
21
|
+
erubis (~> 2.7.0)
|
|
22
|
+
activemodel (4.1.6)
|
|
23
|
+
activesupport (= 4.1.6)
|
|
24
|
+
builder (~> 3.1)
|
|
25
|
+
activerecord (4.1.6)
|
|
26
|
+
activemodel (= 4.1.6)
|
|
27
|
+
activesupport (= 4.1.6)
|
|
28
|
+
arel (~> 5.0.0)
|
|
29
|
+
activesupport (4.1.6)
|
|
30
|
+
i18n (~> 0.6, >= 0.6.9)
|
|
31
|
+
json (~> 1.7, >= 1.7.7)
|
|
32
|
+
minitest (~> 5.1)
|
|
26
33
|
thread_safe (~> 0.1)
|
|
27
|
-
tzinfo (~>
|
|
28
|
-
arel (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
capybara (2.2.1)
|
|
34
|
+
tzinfo (~> 1.1)
|
|
35
|
+
arel (5.0.1.20140414130214)
|
|
36
|
+
builder (3.2.2)
|
|
37
|
+
capybara (2.4.4)
|
|
32
38
|
mime-types (>= 1.16)
|
|
33
39
|
nokogiri (>= 1.3.3)
|
|
34
40
|
rack (>= 1.0.0)
|
|
35
41
|
rack-test (>= 0.5.4)
|
|
36
42
|
xpath (~> 2.0)
|
|
37
43
|
diff-lcs (1.2.5)
|
|
38
|
-
docile (1.1.
|
|
44
|
+
docile (1.1.5)
|
|
39
45
|
erubis (2.7.0)
|
|
40
|
-
gem-release (0.7.1)
|
|
41
46
|
hike (1.2.3)
|
|
42
|
-
i18n (0.6.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
mime-types (
|
|
47
|
-
mini_portile (0.
|
|
48
|
-
minitest (4.
|
|
49
|
-
multi_json (1.
|
|
50
|
-
nokogiri (1.6.1)
|
|
51
|
-
mini_portile (
|
|
52
|
-
polyglot (0.3.3)
|
|
47
|
+
i18n (0.6.11)
|
|
48
|
+
json (1.8.1)
|
|
49
|
+
mail (2.6.1)
|
|
50
|
+
mime-types (>= 1.16, < 3)
|
|
51
|
+
mime-types (2.4.1)
|
|
52
|
+
mini_portile (0.6.0)
|
|
53
|
+
minitest (5.4.2)
|
|
54
|
+
multi_json (1.10.1)
|
|
55
|
+
nokogiri (1.6.3.1)
|
|
56
|
+
mini_portile (= 0.6.0)
|
|
53
57
|
rack (1.5.2)
|
|
54
58
|
rack-test (0.6.2)
|
|
55
59
|
rack (>= 1.0)
|
|
56
|
-
rails (4.
|
|
57
|
-
actionmailer (= 4.
|
|
58
|
-
actionpack (= 4.
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
rails (4.1.6)
|
|
61
|
+
actionmailer (= 4.1.6)
|
|
62
|
+
actionpack (= 4.1.6)
|
|
63
|
+
actionview (= 4.1.6)
|
|
64
|
+
activemodel (= 4.1.6)
|
|
65
|
+
activerecord (= 4.1.6)
|
|
66
|
+
activesupport (= 4.1.6)
|
|
61
67
|
bundler (>= 1.3.0, < 2.0)
|
|
62
|
-
railties (= 4.
|
|
63
|
-
sprockets-rails (~> 2.0
|
|
64
|
-
railties (4.
|
|
65
|
-
actionpack (= 4.
|
|
66
|
-
activesupport (= 4.
|
|
68
|
+
railties (= 4.1.6)
|
|
69
|
+
sprockets-rails (~> 2.0)
|
|
70
|
+
railties (4.1.6)
|
|
71
|
+
actionpack (= 4.1.6)
|
|
72
|
+
activesupport (= 4.1.6)
|
|
67
73
|
rake (>= 0.8.7)
|
|
68
74
|
thor (>= 0.18.1, < 2.0)
|
|
69
|
-
rake (10.
|
|
70
|
-
rspec-core (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
rake (10.3.2)
|
|
76
|
+
rspec-core (3.1.7)
|
|
77
|
+
rspec-support (~> 3.1.0)
|
|
78
|
+
rspec-expectations (3.1.2)
|
|
79
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
80
|
+
rspec-support (~> 3.1.0)
|
|
81
|
+
rspec-mocks (3.1.3)
|
|
82
|
+
rspec-support (~> 3.1.0)
|
|
83
|
+
rspec-rails (3.1.0)
|
|
75
84
|
actionpack (>= 3.0)
|
|
76
|
-
activemodel (>= 3.0)
|
|
77
85
|
activesupport (>= 3.0)
|
|
78
86
|
railties (>= 3.0)
|
|
79
|
-
rspec-core (~>
|
|
80
|
-
rspec-expectations (~>
|
|
81
|
-
rspec-mocks (~>
|
|
82
|
-
|
|
87
|
+
rspec-core (~> 3.1.0)
|
|
88
|
+
rspec-expectations (~> 3.1.0)
|
|
89
|
+
rspec-mocks (~> 3.1.0)
|
|
90
|
+
rspec-support (~> 3.1.0)
|
|
91
|
+
rspec-support (3.1.2)
|
|
92
|
+
simplecov (0.9.1)
|
|
83
93
|
docile (~> 1.1.0)
|
|
84
|
-
multi_json
|
|
94
|
+
multi_json (~> 1.0)
|
|
85
95
|
simplecov-html (~> 0.8.0)
|
|
86
96
|
simplecov-html (0.8.0)
|
|
87
|
-
slim (2.0
|
|
88
|
-
temple (~> 0.6.
|
|
97
|
+
slim (2.1.0)
|
|
98
|
+
temple (~> 0.6.9)
|
|
89
99
|
tilt (>= 1.3.3, < 2.1)
|
|
90
100
|
spork (0.9.2)
|
|
91
|
-
sprockets (2.
|
|
101
|
+
sprockets (2.12.2)
|
|
92
102
|
hike (~> 1.2)
|
|
93
103
|
multi_json (~> 1.0)
|
|
94
104
|
rack (~> 1.0)
|
|
95
105
|
tilt (~> 1.1, != 1.3.0)
|
|
96
|
-
sprockets-rails (2.0
|
|
106
|
+
sprockets-rails (2.2.0)
|
|
97
107
|
actionpack (>= 3.0)
|
|
98
108
|
activesupport (>= 3.0)
|
|
99
|
-
sprockets (
|
|
100
|
-
sqlite3 (1.3.
|
|
101
|
-
temple (0.6.
|
|
102
|
-
thor (0.
|
|
103
|
-
thread_safe (0.
|
|
104
|
-
atomic
|
|
109
|
+
sprockets (>= 2.8, < 4.0)
|
|
110
|
+
sqlite3 (1.3.9)
|
|
111
|
+
temple (0.6.9)
|
|
112
|
+
thor (0.19.1)
|
|
113
|
+
thread_safe (0.3.4)
|
|
105
114
|
tilt (1.4.1)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
polyglot (>= 0.3.1)
|
|
109
|
-
tzinfo (0.3.38)
|
|
115
|
+
tzinfo (1.2.2)
|
|
116
|
+
thread_safe (~> 0.1)
|
|
110
117
|
watchr (0.7)
|
|
111
118
|
xpath (2.0.0)
|
|
112
119
|
nokogiri (~> 1.3)
|
|
@@ -116,9 +123,9 @@ PLATFORMS
|
|
|
116
123
|
|
|
117
124
|
DEPENDENCIES
|
|
118
125
|
capybara
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
rspec-rails
|
|
126
|
+
rails (>= 4.1)
|
|
127
|
+
rows_controller!
|
|
128
|
+
rspec-rails (>= 3.1)
|
|
122
129
|
simplecov
|
|
123
130
|
slim
|
|
124
131
|
spork
|
data/SNIPPETS
CHANGED
data/rows_controller.gemspec
CHANGED
|
@@ -5,20 +5,20 @@ require 'rows_controller/version'
|
|
|
5
5
|
|
|
6
6
|
# Describe your gem and declare its dependencies:
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
|
-
s.name =
|
|
8
|
+
s.name = 'rows_controller'
|
|
9
9
|
s.version = Rows::VERSION
|
|
10
10
|
s.licenses = ['MIT']
|
|
11
11
|
s.platform = Gem::Platform::RUBY
|
|
12
|
-
s.summary =
|
|
13
|
-
s.description =
|
|
12
|
+
s.summary = 'RowsController DRYs your controllers.'
|
|
13
|
+
s.description = 'YourController < RowsController ( < ApplicationController).'
|
|
14
14
|
s.authors = ['Dittmar Krall']
|
|
15
15
|
s.email = ['dittmar.krall@matique.de']
|
|
16
|
-
s.homepage =
|
|
16
|
+
s.homepage = 'http://matique.de'
|
|
17
17
|
|
|
18
18
|
s.files = `git ls-files`.split("\n")
|
|
19
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
20
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
21
|
-
s.require_paths = [
|
|
21
|
+
s.require_paths = ['lib']
|
|
22
22
|
|
|
23
23
|
s.add_development_dependency 'sqlite3', '~> 0' # for testing
|
|
24
24
|
s.add_development_dependency 'rspec-rails', '~> 0'
|
|
@@ -9,9 +9,9 @@ describe OrdersController, ':' do
|
|
|
9
9
|
describe "#{action}" do
|
|
10
10
|
it "renders the '#{action}' template" do
|
|
11
11
|
get action.to_sym
|
|
12
|
-
response.code.
|
|
13
|
-
response.
|
|
14
|
-
response.body.
|
|
12
|
+
expect(response.code).to eq('200')
|
|
13
|
+
expect(response).to render_template("rows/#{action}")
|
|
14
|
+
expect(response.body).to eq('')
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
end
|
|
@@ -20,58 +20,58 @@ describe OrdersController, ':' do
|
|
|
20
20
|
describe "#{action}" do
|
|
21
21
|
it "renders the '#{action}' template" do
|
|
22
22
|
get action.to_sym, :id => order.id
|
|
23
|
-
response.code.
|
|
24
|
-
response.
|
|
25
|
-
response.body.
|
|
23
|
+
expect(response.code).to eq('200')
|
|
24
|
+
expect(response).to render_template("rows/#{action}")
|
|
25
|
+
expect(response.body).to eq('')
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
it 'checking resource' do
|
|
31
31
|
get :show, :id => order.id
|
|
32
|
-
subject.send(:resource).
|
|
33
|
-
assigns(:order).
|
|
34
|
-
assigns(:row).
|
|
32
|
+
expect(subject.send(:resource)).to eq(order)
|
|
33
|
+
expect(assigns(:order)).to eq(order)
|
|
34
|
+
expect(assigns(:row)).to eq(order)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
it 'checking resources' do
|
|
38
38
|
get :index
|
|
39
|
-
subject.send(:resources).to_a.
|
|
40
|
-
assigns(:orders).to_a.
|
|
41
|
-
assigns(:orders).
|
|
42
|
-
assigns(:rows).
|
|
39
|
+
expect(subject.send(:resources).to_a).to be_a_kind_of(Array)
|
|
40
|
+
expect(assigns(:orders).to_a).to be_a_kind_of(Array)
|
|
41
|
+
expect(assigns(:orders)).to eq(Order.all)
|
|
42
|
+
expect(assigns(:rows)).to eq(Order.all)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
it 'checking model_class' do
|
|
46
46
|
get :show, :id => order.id
|
|
47
|
-
subject.send(:model_class).
|
|
48
|
-
subject.send(:model_name).
|
|
49
|
-
subject.send(:model_symbol).
|
|
50
|
-
subject.send(:model_symbol_plural).
|
|
47
|
+
expect(subject.send(:model_class)).to eq(Order)
|
|
48
|
+
expect(subject.send(:model_name)).to eq('Order')
|
|
49
|
+
expect(subject.send(:model_symbol)).to eq('order')
|
|
50
|
+
expect(subject.send(:model_symbol_plural)).to eq('orders')
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
it 'should update' do
|
|
54
54
|
put :update, { id: order.id, order: {name: 'name'} }
|
|
55
|
-
response.
|
|
56
|
-
response.
|
|
55
|
+
expect(response).to be_truthy
|
|
56
|
+
expect(response).to redirect_to(action: :edit)
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
it 'should update #2' do
|
|
60
60
|
put :update, { id: order.id, commit: 'OK', order: {name: 'name'} }
|
|
61
|
-
response.
|
|
62
|
-
response.
|
|
61
|
+
expect(response).to be_truthy
|
|
62
|
+
expect(response).to redirect_to(action: :index)
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
it 'should not update' do
|
|
66
66
|
put :update, { id: order.id, order: {name: 'error'} }
|
|
67
|
-
response.
|
|
68
|
-
response.
|
|
67
|
+
expect(response).to be_success
|
|
68
|
+
expect(response).to render_template('rows/edit')
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
it 'should not create' do
|
|
72
72
|
post :create, { id: order.id, order: {name: 'error'} }
|
|
73
|
-
response.
|
|
74
|
-
response.
|
|
73
|
+
expect(response).to be_success
|
|
74
|
+
expect(response).to render_template('rows/new')
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
end
|
|
@@ -84,9 +84,9 @@ end
|
|
|
84
84
|
describe CategoriesController do
|
|
85
85
|
it 'checking model_class' do
|
|
86
86
|
get :index
|
|
87
|
-
subject.send(:model_class).
|
|
88
|
-
subject.send(:model_name).
|
|
89
|
-
subject.send(:model_symbol).
|
|
90
|
-
subject.send(:model_symbol_plural).
|
|
87
|
+
expect(subject.send(:model_class)).to eq(Order)
|
|
88
|
+
expect(subject.send(:model_name)).to eq('Order')
|
|
89
|
+
expect(subject.send(:model_symbol)).to eq('order')
|
|
90
|
+
expect(subject.send(:model_symbol_plural)).to eq('orders')
|
|
91
91
|
end
|
|
92
92
|
end
|
data/spec/dummy/Rakefile
CHANGED
data/spec/dummy/bin/rake
ADDED
|
@@ -2,7 +2,7 @@ require File.expand_path('../boot', __FILE__)
|
|
|
2
2
|
|
|
3
3
|
require 'rails/all'
|
|
4
4
|
|
|
5
|
-
Bundler.require(*Rails.groups
|
|
5
|
+
Bundler.require(*Rails.groups)
|
|
6
6
|
require "rows_controller"
|
|
7
7
|
|
|
8
8
|
module Dummy
|
|
@@ -18,11 +18,6 @@ module Dummy
|
|
|
18
18
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
19
19
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
20
20
|
# config.i18n.default_locale = :de
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# Old stuff
|
|
24
|
-
config.encoding = "utf-8"
|
|
25
|
-
config.assets.enabled = true
|
|
26
|
-
config.assets.version = '1.0'
|
|
27
21
|
end
|
|
28
22
|
end
|
|
23
|
+
|
data/spec/dummy/config/boot.rb
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# Set up gems listed in the Gemfile.
|
|
2
2
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
|
3
3
|
|
|
4
|
-
require 'bundler/setup' if File.
|
|
5
|
-
|
|
4
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
|
6
5
|
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
Rails.application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
3
|
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
|
@@ -19,11 +19,19 @@ Dummy::Application.configure do
|
|
|
19
19
|
# Print deprecation notices to the Rails logger.
|
|
20
20
|
config.active_support.deprecation = :log
|
|
21
21
|
|
|
22
|
-
# Raise an error on page load if there are pending migrations
|
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
|
23
23
|
config.active_record.migration_error = :page_load
|
|
24
24
|
|
|
25
25
|
# Debug mode disables concatenation and preprocessing of assets.
|
|
26
26
|
# This option may cause significant delays in view rendering with a large
|
|
27
27
|
# number of complex assets.
|
|
28
28
|
config.assets.debug = true
|
|
29
|
+
|
|
30
|
+
# Adds additional error checking when serving assets at runtime.
|
|
31
|
+
# Checks for improperly declared sprockets dependencies.
|
|
32
|
+
# Raises helpful error messages.
|
|
33
|
+
config.assets.raise_runtime_errors = true
|
|
34
|
+
|
|
35
|
+
# Raises error for missing translations
|
|
36
|
+
# config.action_view.raise_on_missing_translations = true
|
|
29
37
|
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
Rails.application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
3
|
|
|
4
4
|
# Code is not reloaded between requests.
|
|
5
5
|
config.cache_classes = true
|
|
6
6
|
|
|
7
7
|
# Eager load code on boot. This eager loads most of Rails and
|
|
8
|
-
# your application in memory, allowing both
|
|
8
|
+
# your application in memory, allowing both threaded web servers
|
|
9
9
|
# and those relying on copy on write to perform better.
|
|
10
10
|
# Rake tasks automatically ignore this option for performance.
|
|
11
11
|
config.eager_load = true
|
|
@@ -32,8 +32,7 @@ Dummy::Application.configure do
|
|
|
32
32
|
# Generate digests for assets URLs.
|
|
33
33
|
config.assets.digest = true
|
|
34
34
|
|
|
35
|
-
#
|
|
36
|
-
config.assets.version = '1.0'
|
|
35
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
|
37
36
|
|
|
38
37
|
# Specifies the header that your server uses for sending files.
|
|
39
38
|
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
|
@@ -57,16 +56,12 @@ Dummy::Application.configure do
|
|
|
57
56
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
58
57
|
# config.action_controller.asset_host = "http://assets.example.com"
|
|
59
58
|
|
|
60
|
-
# Precompile additional assets.
|
|
61
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
|
62
|
-
# config.assets.precompile += %w( search.js )
|
|
63
|
-
|
|
64
59
|
# Ignore bad email addresses and do not raise email delivery errors.
|
|
65
60
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
66
61
|
# config.action_mailer.raise_delivery_errors = false
|
|
67
62
|
|
|
68
63
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
69
|
-
# the I18n.default_locale when a translation
|
|
64
|
+
# the I18n.default_locale when a translation cannot be found).
|
|
70
65
|
config.i18n.fallbacks = true
|
|
71
66
|
|
|
72
67
|
# Send deprecation notices to registered listeners.
|
|
@@ -77,4 +72,7 @@ Dummy::Application.configure do
|
|
|
77
72
|
|
|
78
73
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
79
74
|
config.log_formatter = ::Logger::Formatter.new
|
|
75
|
+
|
|
76
|
+
# Do not dump schema after migrations.
|
|
77
|
+
config.active_record.dump_schema_after_migration = false
|
|
80
78
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
Rails.application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
3
|
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
|
@@ -14,7 +14,7 @@ Dummy::Application.configure do
|
|
|
14
14
|
|
|
15
15
|
# Configure static asset server for tests with Cache-Control for performance.
|
|
16
16
|
config.serve_static_assets = true
|
|
17
|
-
config.static_cache_control =
|
|
17
|
+
config.static_cache_control = 'public, max-age=3600'
|
|
18
18
|
|
|
19
19
|
# Show full error reports and disable caching.
|
|
20
20
|
config.consider_all_requests_local = true
|
|
@@ -33,4 +33,7 @@ Dummy::Application.configure do
|
|
|
33
33
|
|
|
34
34
|
# Print deprecation notices to the stderr.
|
|
35
35
|
config.active_support.deprecation = :stderr
|
|
36
|
+
|
|
37
|
+
# Raises error for missing translations
|
|
38
|
+
# config.action_view.raise_on_missing_translations = true
|
|
36
39
|
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
development:
|
|
2
|
+
secret_key_base: d61c1f2b3e62e0a361915489159b199d7ee5326f280f08c5351f947aaeee33a6687e5219bb995147450a7a2905d6340e290de04fecbc10663743271183b7a2d6
|
|
3
|
+
|
|
4
|
+
test:
|
|
5
|
+
secret_key_base: 0844f902ca7927b7b59e7944e0771b8089ac87717750395210051fcf8b1eff849b8e6a9d3a8bd2f41a07fbae0c24c8c37cf0b76d96f6ab33be0ec2b433ddca85
|
|
6
|
+
|
|
7
|
+
# Do not keep production secrets in the repository,
|
|
8
|
+
# instead read values from the environment.
|
|
9
|
+
production:
|
|
10
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
data/spec/dummy/db/test.sqlite3
CHANGED
|
Binary file
|
data/spec/features/order_spec.rb
CHANGED
|
@@ -7,32 +7,32 @@ describe "Order" do
|
|
|
7
7
|
|
|
8
8
|
it 'should be created' do
|
|
9
9
|
visit "/orders"
|
|
10
|
-
page.
|
|
10
|
+
expect(page).to have_content("is empty")
|
|
11
11
|
|
|
12
12
|
click_link "Create"
|
|
13
13
|
fill_in "Name", :with => "a name"
|
|
14
14
|
click_button "Create"
|
|
15
|
-
page.
|
|
16
|
-
page.
|
|
15
|
+
expect(page).to have_content("Order created.")
|
|
16
|
+
expect(page).to have_content("Editing Order")
|
|
17
17
|
|
|
18
|
-
Order.all.first.name.
|
|
18
|
+
expect(Order.all.first.name).to eq("a name")
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
it 'should be deleted' do
|
|
22
22
|
Order.create
|
|
23
23
|
n = Order.all.length
|
|
24
24
|
visit "/orders"
|
|
25
|
-
page.
|
|
25
|
+
expect(page).to have_content("Listing Order")
|
|
26
26
|
|
|
27
27
|
click_link "Delete"
|
|
28
|
-
page.
|
|
29
|
-
Order.all.length.
|
|
28
|
+
expect(page).to have_content("Order deleted.")
|
|
29
|
+
expect(Order.all.length).to eq((n - 1))
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
it 'index should have check_box for multi_selection' do
|
|
33
33
|
Order.create :name => 'name', :qty => 123
|
|
34
34
|
visit "/orders"
|
|
35
|
-
page.
|
|
35
|
+
expect(page).to have_css('table tr input[name="multi_selection[]"]')
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
it 'should be copied' do
|
|
@@ -41,14 +41,14 @@ describe "Order" do
|
|
|
41
41
|
n = Order.all.length
|
|
42
42
|
visit "/orders/#{order.id}/copy"
|
|
43
43
|
|
|
44
|
-
page.
|
|
44
|
+
expect(page).to have_content("New")
|
|
45
45
|
fill_in "Name", :with => "a name"
|
|
46
46
|
click_button "OK"
|
|
47
47
|
|
|
48
|
-
Order.all.length.
|
|
48
|
+
expect(Order.all.length).to eq(n + 1)
|
|
49
49
|
order2 = Order.find(order.id + 1)
|
|
50
|
-
order2.name.
|
|
51
|
-
order2.qty.
|
|
50
|
+
expect(order2.name).to_not eq(order.name)
|
|
51
|
+
expect(order2.qty).to eq(order.qty)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
end
|
data/spec/models/order_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rows_controller
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dittmar Krall
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sqlite3
|
|
@@ -102,6 +102,9 @@ files:
|
|
|
102
102
|
- spec/dummy/app/models/order.rb
|
|
103
103
|
- spec/dummy/app/views/layouts/application.html.erb
|
|
104
104
|
- spec/dummy/app/views/orders/_form.html.erb
|
|
105
|
+
- spec/dummy/bin/bundle
|
|
106
|
+
- spec/dummy/bin/rails
|
|
107
|
+
- spec/dummy/bin/rake
|
|
105
108
|
- spec/dummy/config.ru
|
|
106
109
|
- spec/dummy/config/application.rb
|
|
107
110
|
- spec/dummy/config/boot.rb
|
|
@@ -110,9 +113,11 @@ files:
|
|
|
110
113
|
- spec/dummy/config/environments/development.rb
|
|
111
114
|
- spec/dummy/config/environments/production.rb
|
|
112
115
|
- spec/dummy/config/environments/test.rb
|
|
116
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
|
113
117
|
- spec/dummy/config/initializers/secret_token.rb
|
|
114
118
|
- spec/dummy/config/initializers/session_store.rb
|
|
115
119
|
- spec/dummy/config/routes.rb
|
|
120
|
+
- spec/dummy/config/secrets.yml
|
|
116
121
|
- spec/dummy/db/migrate/001_create_orders.rb
|
|
117
122
|
- spec/dummy/db/schema.rb
|
|
118
123
|
- spec/dummy/db/test.sqlite3
|
|
@@ -142,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
142
147
|
version: '0'
|
|
143
148
|
requirements: []
|
|
144
149
|
rubyforge_project:
|
|
145
|
-
rubygems_version: 2.2
|
|
150
|
+
rubygems_version: 2.4.2
|
|
146
151
|
signing_key:
|
|
147
152
|
specification_version: 4
|
|
148
153
|
summary: RowsController DRYs your controllers.
|