middleware_autocomplete 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c7ea7cad3546dbbe329f6ffd3f5f87808cfc4cc
4
- data.tar.gz: 9f8b5102c8697c1980dcec0409c9d51742a320b6
3
+ metadata.gz: 83b22cefcf7c585981197dd1fb72555e155f6476
4
+ data.tar.gz: 4078dd93c6872ee571d2a1438d5e6030d2c230b9
5
5
  SHA512:
6
- metadata.gz: f3211cbb3d7ab01901ca00df2ee68bab9ab1993f7a4a97a6804c0346ab60fb1a55ffac2b5aff57709fd2a2160b4a7f87158c974cfa7d8583f962cd315e9a48b5
7
- data.tar.gz: 1149f3fec5817c6a08198989a37ad9e5aeb3731694bbbfb0b59b6ec2a418f7824cec2fe682c1d2602dd70ce89dba4a1db52543312662156a1aa19f78971d590a
6
+ metadata.gz: ce20706fbe73f88a928e062ec33ab36c04787e3788f394899ac8ce10f9749cfa24a1ac135f4b4745bdfde4e0654231a61354a7f5fb5783386acb79e85f42160d
7
+ data.tar.gz: 0dd638df1356dfbafcf5ddccd39da9de96e314fd944e8b298dba4c8564a2574b70053af18e0945d72eb9457fe80a2f0b528fed8fbb5124e49b586611a68e9ccc
@@ -1,16 +1,36 @@
1
1
  require "middleware_autocomplete/engine"
2
2
 
3
3
  module MiddlewareAutocomplete
4
- autoload :Base, 'middleware_autocomplete/base'
5
- autoload :Router, 'middleware_autocomplete/router'
4
+ autoload :Base, 'middleware_autocomplete/base'
5
+ autoload :Router, 'middleware_autocomplete/router'
6
+ autoload :UrlHelpers, 'middleware_autocomplete/url_helpers'
6
7
 
7
8
  # Path namespace for autocompletes
8
9
  mattr_accessor :namespace
9
- @@namespace = '/autocompletes'
10
+ @@namespace = '/autocomplete'
10
11
 
11
12
  # Default content_type
12
13
  mattr_accessor :content_type
13
14
  @@content_type = :json
14
15
 
16
+ # Wraps search requests with ActiveRecord::Base.connection_pool.with_connection
17
+ # It opens and closes connection to db when required
18
+ # If you are using AR to get search results keep it turned on
19
+ mattr_accessor :use_with_connection
20
+ @@use_with_connection = true
21
+
15
22
  ROUTES = ActiveSupport::OrderedHash.new
23
+
24
+ def self.setup
25
+ yield self
26
+ end
27
+
28
+ def self.load_routes
29
+ Base.descendants.each do |klass|
30
+ ROUTES[klass.route] = klass
31
+ end
32
+
33
+ UrlHelpers.generate_helpers!
34
+ Rails.application.routes.named_routes.module.send(:include, UrlHelpers)
35
+ end
16
36
  end
@@ -3,58 +3,75 @@ module MiddlewareAutocomplete
3
3
  class << self
4
4
  attr_accessor :namespace, :path, :route_name, :content_type, :search_key
5
5
 
6
- def setup
7
- autocomplete_klasses = descendants
8
-
9
- autocomplete_klasses.each do |klass|
10
- ROUTES[klass.route] = klass
11
- end
12
-
13
- # Add url helpers namespace_route_path
14
- Rails.application.routes.named_routes.module.module_eval do
15
- autocomplete_klasses.each do |klass|
16
- define_method "#{klass.route_name}_path" do
17
- klass.route
18
- end
19
- end
6
+ # Calls user defined method to return results
7
+ # Wraps this method with AR with_connection to prevent connection leaks
8
+ #
9
+ # ==== Attributes
10
+ #
11
+ # * +params+ - Params hash passed to request
12
+ def perform(params)
13
+ if use_with_connection
14
+ with_connection { search(params) }
15
+ else
16
+ search(params)
20
17
  end
21
18
  end
22
19
 
20
+ # Full path to the Autocomplete class
23
21
  def route
24
22
  [namespace, path].join('/')
25
23
  end
26
24
 
25
+ # Path without namespace
27
26
  def path
28
27
  @path || default_path
29
28
  end
30
29
 
31
- def default_path
32
- name.demodulize.sub(/Autocomplete\Z/, '').underscore
30
+ # Route name to access Autocomplete search, e.g. autocomplete_posts_path
31
+ def route_name
32
+ @route_name || default_route_name
33
33
  end
34
34
 
35
35
  def namespace
36
36
  @namespace || MiddlewareAutocomplete.namespace
37
37
  end
38
38
 
39
- def route_name
40
- @route_name || default_route_name
41
- end
42
-
43
- def default_route_name
44
- "autocomplete_#{default_path}"
39
+ def use_with_connection
40
+ @use_with_connection || MiddlewareAutocomplete.use_with_connection
45
41
  end
46
42
 
47
- def search
43
+ # Returns search results for autocompletition
44
+ # Result should be in the same format that your content_type
45
+ # Should be defined by user
46
+ def search(params)
48
47
  raise NotImplementedError
49
48
  end
50
49
 
50
+ # Content type symbol, e.g. :json, :xml
51
51
  def content_type
52
52
  @content_type || MiddlewareAutocomplete.content_type
53
53
  end
54
54
 
55
+ # Content type string, e.g. 'application/json', 'application/xml'
55
56
  def content_type_string
56
57
  Mime::Type.lookup_by_extension(content_type).to_s
57
58
  end
59
+
60
+ private
61
+
62
+ def default_route_name
63
+ "autocomplete_#{default_path}"
64
+ end
65
+
66
+ def default_path
67
+ name.demodulize.sub(/Autocomplete\Z/, '').underscore
68
+ end
69
+
70
+ def with_connection
71
+ ActiveRecord::Base.connection_pool.with_connection do
72
+ yield
73
+ end
74
+ end
58
75
  end
59
76
  end
60
77
  end
@@ -5,7 +5,7 @@ module MiddlewareAutocomplete
5
5
  Dir.glob(Rails.root + "app/autocompletes/**/*_autocomplete.rb").each do |c|
6
6
  require_dependency(c)
7
7
  end
8
- MiddlewareAutocomplete::Base.setup
8
+ MiddlewareAutocomplete.load_routes
9
9
  end
10
10
 
11
11
  initializer 'middleware_autocomplete.connect_middleware_router' do |app|
@@ -5,16 +5,12 @@ module MiddlewareAutocomplete
5
5
  end
6
6
 
7
7
  def call(env)
8
- if (klass = ROUTES[env['REQUEST_PATH']])
9
- request = Rack::Request.new(env)
10
- result = ActiveRecord::Base.connection_pool.with_connection do
11
- klass.search(request.params)
12
- end
8
+ if (klass = ROUTES[env['PATH_INFO']])
9
+ result = klass.perform(Rack::Request.new(env).params)
13
10
  [200, { 'Content-Type' => klass.content_type_string }, [result]]
14
11
  else
15
12
  @app.call(env)
16
13
  end
17
14
  end
18
-
19
15
  end
20
16
  end
@@ -0,0 +1,18 @@
1
+ module MiddlewareAutocomplete
2
+ module UrlHelpers
3
+ def self.remove_helpers!
4
+ self.instance_methods.map(&:to_s).grep(/_(url|path)$/).each do |method|
5
+ remove_method method
6
+ end
7
+ end
8
+
9
+ def self.generate_helpers!
10
+ # Add url helpers namespace_route_path
11
+ MiddlewareAutocomplete::ROUTES.each do |route_path, klass|
12
+ define_method "#{klass.route_name}_path" do
13
+ route_path
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module MiddlewareAutocomplete
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  class PostsAutocomplete < MiddlewareAutocomplete::Base
2
2
  def self.search(params)
3
- Post.where("title LIKE ?", "#{params['q']}_%").limit(10).pluck(:title).to_json
3
+ Post.where("title LIKE ?", "#{params['q']}_%")
4
+ .order(:title).limit(10).pluck(:title).to_json
4
5
  end
5
6
  end
@@ -0,0 +1,2 @@
1
+ class Post < ActiveRecord::Base
2
+ end
Binary file
@@ -0,0 +1,9 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :posts do |t|
4
+ t.string :title
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,22 @@
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 that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20140414220337) do
15
+
16
+ create_table "posts", force: true do |t|
17
+ t.string "title"
18
+ t.datetime "created_at"
19
+ t.datetime "updated_at"
20
+ end
21
+
22
+ end
Binary file
@@ -0,0 +1,10 @@
1
+  (127.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (59.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreatePosts (20140414220337)
6
+  (0.1ms) begin transaction
7
+  (0.6ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime)
8
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140414220337"]]
9
+  (70.7ms) commit transaction
10
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -2,19 +2,474 @@
2
2
  --------------------------------------
3
3
  MiddlewareAutocompleteTest: test_truth
4
4
  --------------------------------------
5
+  (0.1ms) rollback transaction
6
+  (0.1ms) begin transaction
7
+ ---------------------------------------------------------
8
+ NavigationTest: test_returns_json_from_autocomplete_route
9
+ ---------------------------------------------------------
10
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:16:32 +0300
11
+  (0.1ms) rollback transaction
12
+  (0.1ms) begin transaction
13
+ ---------------------------------------------
14
+ MiddlewareAutocompleteTest: test_loads_routes
15
+ ---------------------------------------------
16
+  (0.0ms) rollback transaction
17
+  (0.0ms) begin transaction
18
+ --------------------------------------
19
+ MiddlewareAutocompleteTest: test_truth
20
+ --------------------------------------
21
+  (0.0ms) rollback transaction
22
+  (0.1ms) begin transaction
23
+ ---------------------------------------------------------
24
+ NavigationTest: test_returns_json_from_autocomplete_route
25
+ ---------------------------------------------------------
26
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:17:42 +0300
27
+  (0.1ms) rollback transaction
28
+  (0.0ms) begin transaction
29
+ ---------------------------------------------
30
+ MiddlewareAutocompleteTest: test_loads_routes
31
+ ---------------------------------------------
32
+  (0.0ms) rollback transaction
33
+  (0.0ms) begin transaction
34
+ --------------------------------------
35
+ MiddlewareAutocompleteTest: test_truth
36
+ --------------------------------------
37
+  (0.0ms) rollback transaction
38
+  (0.1ms) begin transaction
39
+ ---------------------------------------------------------
40
+ NavigationTest: test_returns_json_from_autocomplete_route
41
+ ---------------------------------------------------------
42
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:18:22 +0300
43
+  (0.2ms) rollback transaction
44
+  (0.1ms) begin transaction
45
+ ---------------------------------------------
46
+ MiddlewareAutocompleteTest: test_loads_routes
47
+ ---------------------------------------------
48
+  (0.1ms) rollback transaction
49
+  (0.1ms) begin transaction
50
+ --------------------------------------
51
+ MiddlewareAutocompleteTest: test_truth
52
+ --------------------------------------
53
+  (0.1ms) rollback transaction
54
+  (0.1ms) begin transaction
55
+ ---------------------------------------------------------
56
+ NavigationTest: test_returns_json_from_autocomplete_route
57
+ ---------------------------------------------------------
58
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:21:44 +0300
59
+  (0.1ms) rollback transaction
60
+  (0.1ms) begin transaction
61
+ ---------------------------------------------
62
+ MiddlewareAutocompleteTest: test_loads_routes
63
+ ---------------------------------------------
64
+  (0.1ms) rollback transaction
65
+  (0.1ms) begin transaction
66
+ --------------------------------------
67
+ MiddlewareAutocompleteTest: test_truth
68
+ --------------------------------------
69
+  (0.1ms) rollback transaction
70
+  (0.1ms) begin transaction
71
+ ---------------------------------------------------------
72
+ NavigationTest: test_returns_json_from_autocomplete_route
73
+ ---------------------------------------------------------
74
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:26:35 +0300
75
+  (0.0ms) rollback transaction
76
+  (0.1ms) begin transaction
77
+ ---------------------------------------------
78
+ MiddlewareAutocompleteTest: test_loads_routes
79
+ ---------------------------------------------
80
+  (0.0ms) rollback transaction
81
+  (0.0ms) begin transaction
82
+ --------------------------------------
83
+ MiddlewareAutocompleteTest: test_truth
84
+ --------------------------------------
85
+  (0.0ms) rollback transaction
86
+  (0.1ms) begin transaction
87
+ ---------------------------------------------------------
88
+ NavigationTest: test_returns_json_from_autocomplete_route
89
+ ---------------------------------------------------------
90
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:26:38 +0300
91
+  (0.1ms) rollback transaction
92
+  (0.1ms) begin transaction
93
+ ---------------------------------------------
94
+ MiddlewareAutocompleteTest: test_loads_routes
95
+ ---------------------------------------------
96
+  (0.1ms) rollback transaction
97
+  (0.0ms) begin transaction
98
+ --------------------------------------
99
+ MiddlewareAutocompleteTest: test_truth
100
+ --------------------------------------
101
+  (0.0ms) rollback transaction
102
+  (0.1ms) begin transaction
103
+ ---------------------------------------------------------
104
+ NavigationTest: test_returns_json_from_autocomplete_route
105
+ ---------------------------------------------------------
106
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:27:23 +0300
107
+  (0.1ms) rollback transaction
108
+  (0.1ms) begin transaction
109
+ ---------------------------------------------
110
+ MiddlewareAutocompleteTest: test_loads_routes
111
+ ---------------------------------------------
112
+  (0.1ms) rollback transaction
113
+  (0.1ms) begin transaction
114
+ --------------------------------------
115
+ MiddlewareAutocompleteTest: test_truth
116
+ --------------------------------------
117
+  (0.1ms) rollback transaction
118
+  (0.1ms) begin transaction
119
+ ---------------------------------------------------------
120
+ NavigationTest: test_returns_json_from_autocomplete_route
121
+ ---------------------------------------------------------
122
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:29:38 +0300
123
+  (0.1ms) rollback transaction
124
+  (0.0ms) begin transaction
125
+ ---------------------------------------------
126
+ MiddlewareAutocompleteTest: test_loads_routes
127
+ ---------------------------------------------
128
+  (0.0ms) rollback transaction
129
+  (0.0ms) begin transaction
130
+ --------------------------------------
131
+ MiddlewareAutocompleteTest: test_truth
132
+ --------------------------------------
133
+  (0.0ms) rollback transaction
134
+  (0.1ms) begin transaction
135
+  (0.0ms) rollback transaction
136
+  (0.0ms) begin transaction
137
+  (0.0ms) rollback transaction
138
+  (0.1ms) begin transaction
139
+  (0.0ms) rollback transaction
140
+  (0.1ms) begin transaction
141
+  (0.0ms) rollback transaction
142
+  (0.1ms) begin transaction
143
+  (0.0ms) rollback transaction
144
+  (0.1ms) begin transaction
145
+  (0.0ms) rollback transaction
146
+  (0.1ms) begin transaction
5
147
   (0.0ms) rollback transaction
148
+  (0.0ms) begin transaction
149
+  (0.1ms) rollback transaction
6
150
   (0.1ms) begin transaction
151
+ ---------------------------------------------------------
152
+ NavigationTest: test_returns_json_from_autocomplete_route
153
+ ---------------------------------------------------------
154
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 01:35:51 +0300
155
+  (0.0ms) rollback transaction
156
+  (0.0ms) begin transaction
157
+ ---------------------------------------------
158
+ MiddlewareAutocompleteTest: test_loads_routes
159
+ ---------------------------------------------
160
+  (0.0ms) rollback transaction
161
+  (0.0ms) begin transaction
7
162
  --------------------------------------
8
163
  MiddlewareAutocompleteTest: test_truth
9
164
  --------------------------------------
10
165
   (0.0ms) rollback transaction
11
166
   (0.1ms) begin transaction
167
+  (0.0ms) rollback transaction
168
+  (0.0ms) begin transaction
169
+  (0.0ms) rollback transaction
170
+  (122.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
171
+  (0.1ms) select sqlite_version(*)
172
+  (59.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
173
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
174
+ Migrating to CreatePosts (20140414220337)
175
+  (0.1ms) begin transaction
176
+  (0.5ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime)
177
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140414220337"]]
178
+  (73.5ms) commit transaction
179
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
180
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
181
+  (0.1ms) begin transaction
182
+ Fixture Delete (0.1ms) DELETE FROM "posts"
183
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:38:03', '2014-04-14 22:38:03', 980190962)
184
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:38:03', '2014-04-14 22:38:03', 298486374)
185
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:38:03', '2014-04-14 22:38:03', 113629430)
186
+  (97.5ms) commit transaction
187
+  (0.1ms) begin transaction
188
+ ---------------------------------------------
189
+ MiddlewareAutocompleteTest: test_loads_routes
190
+ ---------------------------------------------
191
+  (0.1ms) rollback transaction
192
+  (0.1ms) begin transaction
193
+ --------------------------------------
194
+ MiddlewareAutocompleteTest: test_truth
195
+ --------------------------------------
196
+  (0.1ms) rollback transaction
197
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
198
+  (0.1ms) begin transaction
199
+ Fixture Delete (0.2ms) DELETE FROM "posts"
200
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:40:17', '2014-04-14 22:40:17', 980190962)
201
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:40:17', '2014-04-14 22:40:17', 298486374)
202
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:40:17', '2014-04-14 22:40:17', 113629430)
203
+  (91.4ms) commit transaction
204
+  (0.1ms) begin transaction
205
+ ---------------------------------------------
206
+ MiddlewareAutocompleteTest: test_loads_routes
207
+ ---------------------------------------------
208
+  (0.1ms) rollback transaction
209
+  (0.1ms) begin transaction
210
+ --------------------------------------
211
+ MiddlewareAutocompleteTest: test_truth
212
+ --------------------------------------
213
+  (0.1ms) rollback transaction
214
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
215
+  (0.1ms) begin transaction
216
+ Fixture Delete (0.2ms) DELETE FROM "posts"
217
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:40:37', '2014-04-14 22:40:37', 980190962)
218
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:40:37', '2014-04-14 22:40:37', 298486374)
219
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:40:37', '2014-04-14 22:40:37', 113629430)
220
+  (126.1ms) commit transaction
221
+  (0.1ms) begin transaction
222
+ --------------------------------------
223
+ MiddlewareAutocompleteTest: test_truth
224
+ --------------------------------------
225
+  (0.1ms) rollback transaction
226
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
227
+  (0.1ms) begin transaction
228
+ Fixture Delete (0.1ms) DELETE FROM "posts"
229
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:43:58', '2014-04-14 22:43:58', 980190962)
230
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:43:58', '2014-04-14 22:43:58', 298486374)
231
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:43:58', '2014-04-14 22:43:58', 113629430)
232
+  (132.1ms) commit transaction
233
+  (0.1ms) begin transaction
234
+ --------------------------------------
235
+ MiddlewareAutocompleteTest: test_truth
236
+ --------------------------------------
237
+  (0.1ms) rollback transaction
238
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
239
+  (0.1ms) begin transaction
240
+ Fixture Delete (0.1ms) DELETE FROM "posts"
241
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-14 22:44:35', '2014-04-14 22:44:35', 980190962)
242
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-14 22:44:35', '2014-04-14 22:44:35', 298486374)
243
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-14 22:44:35', '2014-04-14 22:44:35', 113629430)
244
+  (131.8ms) commit transaction
245
+  (0.2ms) begin transaction
246
+ --------------------------------------
247
+ MiddlewareAutocompleteTest: test_truth
248
+ --------------------------------------
249
+  (0.1ms) rollback transaction
250
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
251
+  (0.1ms) begin transaction
252
+ Fixture Delete (0.1ms) DELETE FROM "posts"
253
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:17:23', '2014-04-15 06:17:23', 980190962)
254
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:17:23', '2014-04-15 06:17:23', 298486374)
255
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:17:23', '2014-04-15 06:17:23', 113629430)
256
+  (78.8ms) commit transaction
257
+  (0.1ms) begin transaction
258
+ --------------------------------------
259
+ MiddlewareAutocompleteTest: test_truth
260
+ --------------------------------------
261
+  (0.0ms) rollback transaction
262
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
263
+  (0.1ms) begin transaction
264
+ Fixture Delete (0.1ms) DELETE FROM "posts"
265
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:17:34', '2014-04-15 06:17:34', 980190962)
266
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:17:34', '2014-04-15 06:17:34', 298486374)
267
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:17:34', '2014-04-15 06:17:34', 113629430)
268
+  (114.0ms) commit transaction
269
+  (0.1ms) begin transaction
270
+ ---------------------------------------------------------
271
+ NavigationTest: test_returns_json_from_autocomplete_route
272
+ ---------------------------------------------------------
273
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:17:34 +0300
274
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') LIMIT 10
275
+  (0.1ms) rollback transaction
276
+  (0.1ms) begin transaction
277
+ --------------------------------------
278
+ MiddlewareAutocompleteTest: test_truth
279
+ --------------------------------------
280
+  (0.0ms) rollback transaction
281
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
282
+  (0.1ms) begin transaction
283
+ Fixture Delete (0.1ms) DELETE FROM "posts"
284
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:19:18', '2014-04-15 06:19:18', 980190962)
285
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:19:18', '2014-04-15 06:19:18', 298486374)
286
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:19:18', '2014-04-15 06:19:18', 113629430)
287
+  (114.3ms) commit transaction
288
+  (0.1ms) begin transaction
289
+ ---------------------------------------------------------
290
+ NavigationTest: test_returns_json_from_autocomplete_route
291
+ ---------------------------------------------------------
292
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:19:18 +0300
293
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') LIMIT 10
294
+  (0.1ms) rollback transaction
295
+  (0.0ms) begin transaction
12
296
  --------------------------------------
13
297
  MiddlewareAutocompleteTest: test_truth
14
298
  --------------------------------------
15
299
   (0.0ms) rollback transaction
300
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
301
+  (0.1ms) begin transaction
302
+ Fixture Delete (0.1ms) DELETE FROM "posts"
303
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:20:12', '2014-04-15 06:20:12', 980190962)
304
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:20:12', '2014-04-15 06:20:12', 298486374)
305
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:20:12', '2014-04-15 06:20:12', 113629430)
306
+  (109.4ms) commit transaction
307
+  (0.1ms) begin transaction
308
+ ---------------------------------------------------------
309
+ NavigationTest: test_returns_json_from_autocomplete_route
310
+ ---------------------------------------------------------
311
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:20:12 +0300
312
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') LIMIT 10
313
+  (0.2ms) rollback transaction
314
+  (0.1ms) begin transaction
315
+ --------------------------------------
316
+ MiddlewareAutocompleteTest: test_truth
317
+ --------------------------------------
318
+  (0.1ms) rollback transaction
319
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
320
+  (0.1ms) begin transaction
321
+ Fixture Delete (0.2ms) DELETE FROM "posts"
322
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:21:26', '2014-04-15 06:21:26', 980190962)
323
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:21:26', '2014-04-15 06:21:26', 298486374)
324
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:21:26', '2014-04-15 06:21:26', 113629430)
325
+  (76.3ms) commit transaction
326
+  (0.1ms) begin transaction
327
+ ---------------------------------------------------------
328
+ NavigationTest: test_returns_json_from_autocomplete_route
329
+ ---------------------------------------------------------
330
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:21:26 +0300
331
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
332
+  (0.2ms) rollback transaction
333
+  (0.1ms) begin transaction
334
+ --------------------------------------
335
+ MiddlewareAutocompleteTest: test_truth
336
+ --------------------------------------
337
+  (0.1ms) rollback transaction
338
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
339
+  (0.1ms) begin transaction
340
+ Fixture Delete (0.1ms) DELETE FROM "posts"
341
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:21:55', '2014-04-15 06:21:55', 980190962)
342
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:21:55', '2014-04-15 06:21:55', 298486374)
343
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:21:55', '2014-04-15 06:21:55', 113629430)
344
+  (81.3ms) commit transaction
345
+  (0.1ms) begin transaction
346
+ ---------------------------------------------------------
347
+ NavigationTest: test_returns_json_from_autocomplete_route
348
+ ---------------------------------------------------------
349
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:21:55 +0300
350
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
351
+  (0.1ms) rollback transaction
16
352
   (0.1ms) begin transaction
17
353
  --------------------------------------
18
354
  MiddlewareAutocompleteTest: test_truth
19
355
  --------------------------------------
20
356
   (0.0ms) rollback transaction
357
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
358
+  (0.1ms) begin transaction
359
+ Fixture Delete (0.1ms) DELETE FROM "posts"
360
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:22:45', '2014-04-15 06:22:45', 980190962)
361
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:22:45', '2014-04-15 06:22:45', 298486374)
362
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:22:45', '2014-04-15 06:22:45', 113629430)
363
+  (110.5ms) commit transaction
364
+  (0.1ms) begin transaction
365
+ ------------------------------------------
366
+ NavigationTest: test_passes_request_params
367
+ ------------------------------------------
368
+ Started GET "/autocomplete/posts?q=Another" for 127.0.0.1 at 2014-04-15 09:22:45 +0300
369
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE 'Another_%') ORDER BY "posts"."title" ASC LIMIT 10
370
+  (0.1ms) rollback transaction
371
+  (0.0ms) begin transaction
372
+ ---------------------------------------------------------
373
+ NavigationTest: test_returns_json_from_autocomplete_route
374
+ ---------------------------------------------------------
375
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:22:45 +0300
376
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
377
+  (0.1ms) rollback transaction
378
+  (0.1ms) begin transaction
379
+ --------------------------------------
380
+ MiddlewareAutocompleteTest: test_truth
381
+ --------------------------------------
382
+  (0.0ms) rollback transaction
383
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
384
+  (0.1ms) begin transaction
385
+ Fixture Delete (0.2ms) DELETE FROM "posts"
386
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:24:24', '2014-04-15 06:24:24', 980190962)
387
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:24:24', '2014-04-15 06:24:24', 298486374)
388
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:24:24', '2014-04-15 06:24:24', 113629430)
389
+  (115.5ms) commit transaction
390
+  (0.1ms) begin transaction
391
+ ------------------------------------------
392
+ NavigationTest: test_passes_request_params
393
+ ------------------------------------------
394
+ Started GET "/autocomplete/posts?q=Another" for 127.0.0.1 at 2014-04-15 09:24:24 +0300
395
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE 'Another_%') ORDER BY "posts"."title" ASC LIMIT 10
396
+  (0.1ms) rollback transaction
397
+  (0.0ms) begin transaction
398
+ ---------------------------------------------------------
399
+ NavigationTest: test_returns_json_from_autocomplete_route
400
+ ---------------------------------------------------------
401
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:24:24 +0300
402
+  (0.1ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
403
+  (0.1ms) rollback transaction
404
+  (0.0ms) begin transaction
405
+ ---------------------------------------------
406
+ MiddlewareAutocompleteTest: test_loads_routes
407
+ ---------------------------------------------
408
+  (0.0ms) rollback transaction
409
+  (0.1ms) begin transaction
410
+ --------------------------------------
411
+ MiddlewareAutocompleteTest: test_truth
412
+ --------------------------------------
413
+  (0.0ms) rollback transaction
414
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
415
+  (0.1ms) begin transaction
416
+ Fixture Delete (0.2ms) DELETE FROM "posts"
417
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:24:36', '2014-04-15 06:24:36', 980190962)
418
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:24:36', '2014-04-15 06:24:36', 298486374)
419
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:24:36', '2014-04-15 06:24:36', 113629430)
420
+  (75.1ms) commit transaction
421
+  (0.1ms) begin transaction
422
+ ------------------------------------------
423
+ NavigationTest: test_passes_request_params
424
+ ------------------------------------------
425
+ Started GET "/autocomplete/posts?q=Another" for 127.0.0.1 at 2014-04-15 09:24:36 +0300
426
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE 'Another_%') ORDER BY "posts"."title" ASC LIMIT 10
427
+  (0.1ms) rollback transaction
428
+  (0.1ms) begin transaction
429
+ ---------------------------------------------------------
430
+ NavigationTest: test_returns_json_from_autocomplete_route
431
+ ---------------------------------------------------------
432
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:24:36 +0300
433
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
434
+  (0.1ms) rollback transaction
435
+  (0.1ms) begin transaction
436
+ ---------------------------------------------
437
+ MiddlewareAutocompleteTest: test_loads_routes
438
+ ---------------------------------------------
439
+  (0.0ms) rollback transaction
440
+  (0.0ms) begin transaction
441
+ --------------------------------------
442
+ MiddlewareAutocompleteTest: test_truth
443
+ --------------------------------------
444
+  (0.0ms) rollback transaction
445
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
446
+  (0.1ms) begin transaction
447
+ Fixture Delete (0.1ms) DELETE FROM "posts"
448
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Title', '2014-04-15 06:44:46', '2014-04-15 06:44:46', 980190962)
449
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Second Title', '2014-04-15 06:44:46', '2014-04-15 06:44:46', 298486374)
450
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "created_at", "updated_at", "id") VALUES ('Another One Title', '2014-04-15 06:44:46', '2014-04-15 06:44:46', 113629430)
451
+  (77.2ms) commit transaction
452
+  (0.1ms) begin transaction
453
+ ------------------------------------------
454
+ NavigationTest: test_passes_request_params
455
+ ------------------------------------------
456
+ Started GET "/autocomplete/posts?q=Another" for 127.0.0.1 at 2014-04-15 09:44:47 +0300
457
+  (0.2ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE 'Another_%') ORDER BY "posts"."title" ASC LIMIT 10
458
+  (0.1ms) rollback transaction
459
+  (0.0ms) begin transaction
460
+ ---------------------------------------------------------
461
+ NavigationTest: test_returns_json_from_autocomplete_route
462
+ ---------------------------------------------------------
463
+ Started GET "/autocomplete/posts" for 127.0.0.1 at 2014-04-15 09:44:47 +0300
464
+  (0.1ms) SELECT "posts"."title" FROM "posts" WHERE (title LIKE '_%') ORDER BY "posts"."title" ASC LIMIT 10
465
+  (0.1ms) rollback transaction
466
+  (0.0ms) begin transaction
467
+ ---------------------------------------------
468
+ MiddlewareAutocompleteTest: test_loads_routes
469
+ ---------------------------------------------
470
+  (0.0ms) rollback transaction
471
+  (0.0ms) begin transaction
472
+ --------------------------------------
473
+ MiddlewareAutocompleteTest: test_truth
474
+ --------------------------------------
475
+  (0.0ms) rollback transaction
@@ -0,0 +1,8 @@
1
+ one:
2
+ title: Title
3
+
4
+ two:
5
+ title: Second Title
6
+
7
+ three:
8
+ title: Another One Title
@@ -1,10 +1,22 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class NavigationTest < ActionDispatch::IntegrationTest
4
- fixtures :all
4
+ def json_response
5
+ ActiveSupport::JSON.decode @response.body
6
+ end
5
7
 
6
- # test "the truth" do
7
- # assert true
8
- # end
8
+ test "returns json from autocomplete route" do
9
+ get autocomplete_posts_path
10
+
11
+ assert_response :success
12
+ assert_equal ['Another One Title', 'Second Title', 'Title'], json_response
13
+ end
14
+
15
+ test "passes request params" do
16
+ get autocomplete_posts_path, q: 'Another'
17
+
18
+ assert_response :success
19
+ assert_equal ['Another One Title'], json_response
20
+ end
9
21
  end
10
22
 
@@ -4,4 +4,8 @@ class MiddlewareAutocompleteTest < ActiveSupport::TestCase
4
4
  test "truth" do
5
5
  assert_kind_of Module, MiddlewareAutocomplete
6
6
  end
7
+
8
+ test "loads routes" do
9
+ assert_equal MiddlewareAutocomplete::ROUTES, {'/autocomplete/posts' => PostsAutocomplete}
10
+ end
7
11
  end
data/test/test_helper.rb CHANGED
@@ -12,7 +12,13 @@ Rails.backtrace_cleaner.remove_silencers!
12
12
  # Load support files
13
13
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
14
 
15
- # Load fixtures from the engine
16
- if ActiveSupport::TestCase.method_defined?(:fixture_path=)
17
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ # if ActiveSupport::TestCase.method_defined?(:fixture_path=)
16
+ # ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
17
+ # end
18
+
19
+ # # Load fixtures from the engine
20
+ # ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
21
+
22
+ class ActiveSupport::TestCase
23
+ fixtures :all
18
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleware_autocomplete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Ilchenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-14 00:00:00.000000000 Z
11
+ date: 2014-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -92,6 +92,7 @@ files:
92
92
  - lib/middleware_autocomplete/base.rb
93
93
  - lib/middleware_autocomplete/engine.rb
94
94
  - lib/middleware_autocomplete/router.rb
95
+ - lib/middleware_autocomplete/url_helpers.rb
95
96
  - lib/middleware_autocomplete/version.rb
96
97
  - test/dummy/README.rdoc
97
98
  - test/dummy/Rakefile
@@ -100,6 +101,7 @@ files:
100
101
  - test/dummy/app/autocompletes/posts_autocomplete.rb
101
102
  - test/dummy/app/controllers/application_controller.rb
102
103
  - test/dummy/app/helpers/application_helper.rb
104
+ - test/dummy/app/models/post.rb
103
105
  - test/dummy/app/views/layouts/application.html.erb
104
106
  - test/dummy/bin/bundle
105
107
  - test/dummy/bin/rails
@@ -122,6 +124,9 @@ files:
122
124
  - test/dummy/config/locales/en.yml
123
125
  - test/dummy/config/routes.rb
124
126
  - test/dummy/config/secrets.yml
127
+ - test/dummy/db/development.sqlite3
128
+ - test/dummy/db/migrate/20140414220337_create_posts.rb
129
+ - test/dummy/db/schema.rb
125
130
  - test/dummy/db/test.sqlite3
126
131
  - test/dummy/log/development.log
127
132
  - test/dummy/log/test.log
@@ -129,6 +134,7 @@ files:
129
134
  - test/dummy/public/422.html
130
135
  - test/dummy/public/500.html
131
136
  - test/dummy/public/favicon.ico
137
+ - test/dummy/test/fixtures/posts.yml
132
138
  - test/integration/navigation_test.rb
133
139
  - test/middleware_autocomplete_test.rb
134
140
  - test/test_helper.rb
@@ -158,41 +164,46 @@ specification_version: 4
158
164
  summary: Fast autocomplete for Rails.
159
165
  test_files:
160
166
  - test/middleware_autocomplete_test.rb
161
- - test/dummy/Rakefile
167
+ - test/test_helper.rb
168
+ - test/dummy/db/development.sqlite3
169
+ - test/dummy/db/test.sqlite3
170
+ - test/dummy/db/migrate/20140414220337_create_posts.rb
171
+ - test/dummy/db/schema.rb
172
+ - test/dummy/README.rdoc
162
173
  - test/dummy/config.ru
163
- - test/dummy/log/development.log
164
- - test/dummy/log/test.log
165
- - test/dummy/bin/bundle
166
- - test/dummy/bin/rails
167
- - test/dummy/bin/rake
168
- - test/dummy/app/autocompletes/posts_autocomplete.rb
169
- - test/dummy/app/controllers/application_controller.rb
170
- - test/dummy/app/views/layouts/application.html.erb
171
- - test/dummy/app/helpers/application_helper.rb
172
- - test/dummy/app/assets/stylesheets/application.css
173
- - test/dummy/app/assets/javascripts/application.js
174
174
  - test/dummy/public/favicon.ico
175
- - test/dummy/public/500.html
176
175
  - test/dummy/public/422.html
177
176
  - test/dummy/public/404.html
178
- - test/dummy/README.rdoc
179
- - test/dummy/config/environments/development.rb
180
- - test/dummy/config/environments/test.rb
181
- - test/dummy/config/environments/production.rb
177
+ - test/dummy/public/500.html
178
+ - test/dummy/bin/rails
179
+ - test/dummy/bin/bundle
180
+ - test/dummy/bin/rake
181
+ - test/dummy/config/boot.rb
182
182
  - test/dummy/config/environment.rb
183
- - test/dummy/config/routes.rb
184
183
  - test/dummy/config/secrets.yml
185
184
  - test/dummy/config/application.rb
186
- - test/dummy/config/locales/en.yml
187
- - test/dummy/config/initializers/filter_parameter_logging.rb
185
+ - test/dummy/config/environments/test.rb
186
+ - test/dummy/config/environments/production.rb
187
+ - test/dummy/config/environments/development.rb
188
+ - test/dummy/config/routes.rb
189
+ - test/dummy/config/initializers/wrap_parameters.rb
190
+ - test/dummy/config/initializers/session_store.rb
188
191
  - test/dummy/config/initializers/backtrace_silencers.rb
189
- - test/dummy/config/initializers/cookies_serializer.rb
190
192
  - test/dummy/config/initializers/mime_types.rb
191
- - test/dummy/config/initializers/wrap_parameters.rb
193
+ - test/dummy/config/initializers/cookies_serializer.rb
194
+ - test/dummy/config/initializers/filter_parameter_logging.rb
192
195
  - test/dummy/config/initializers/inflections.rb
193
- - test/dummy/config/initializers/session_store.rb
194
- - test/dummy/config/boot.rb
195
196
  - test/dummy/config/database.yml
196
- - test/dummy/db/test.sqlite3
197
- - test/test_helper.rb
197
+ - test/dummy/config/locales/en.yml
198
+ - test/dummy/Rakefile
199
+ - test/dummy/app/helpers/application_helper.rb
200
+ - test/dummy/app/views/layouts/application.html.erb
201
+ - test/dummy/app/models/post.rb
202
+ - test/dummy/app/controllers/application_controller.rb
203
+ - test/dummy/app/autocompletes/posts_autocomplete.rb
204
+ - test/dummy/app/assets/javascripts/application.js
205
+ - test/dummy/app/assets/stylesheets/application.css
206
+ - test/dummy/test/fixtures/posts.yml
207
+ - test/dummy/log/development.log
208
+ - test/dummy/log/test.log
198
209
  - test/integration/navigation_test.rb