morse_searchable 0.0.5 → 0.0.6

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: f4e7dedbe6cb3e40bc96a262576d0ffb94cbd6de
4
- data.tar.gz: 3b47da48847d565e638d276b356e7f5972f092b6
3
+ metadata.gz: 9840ce0956c26eaeffbbb29243c46b36d605a433
4
+ data.tar.gz: 1147c9d963d87c4d03b68b32f6bda489b1cadabd
5
5
  SHA512:
6
- metadata.gz: e110b3c1ca071bfe4bebceb7bbafb01e6d04319523f96ecc7e2ea37f1ccff27876cdfc50b64101af2e3ca73552fa550b37d29fa1c44338af44b69175014b2653
7
- data.tar.gz: 7f484cc3bf889f50b354569dbc5973f080d6bd5e357f68dcb786edc02bf21f6dc26bb1b30f80159ec6a0e4e5f252409bb2dc3245f541502360f6af6d6743863a
6
+ metadata.gz: 210411d47906b0c11510edea795d32f9316a14245676c89ea682a92d19e573dd64606dae1c24f072b5e51b2841a06c78be13ded48eeded7faf5ab930a2752976
7
+ data.tar.gz: e7c99edd4bf23b0c968cc226c31166c74557fb3f82a9e3060b63838f787e15d3780e73443d72b512ca0f56b0c247e2529af337f68ba06cbb25cbf531e1379cc9
data/config/routes.rb CHANGED
@@ -5,4 +5,8 @@ Rails.application.routes.draw do
5
5
  get :filters
6
6
  end
7
7
  end
8
+ if Rails.env.test?
9
+ resources :fakes, concerns: :searchable
10
+ end
11
+
8
12
  end
@@ -1,3 +1,3 @@
1
1
  module MorseSearchable
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -0,0 +1,12 @@
1
+ module SearchableConcern
2
+ def self.included(base)
3
+ base.instance_eval do
4
+ concern :searchable do
5
+ collection do
6
+ get :feed
7
+ get :filters
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,11 +1,5 @@
1
1
  require 'spec_helper'
2
- class FakesController
3
- include Searchable
4
2
 
5
- def set_meta_filters_here(args={})
6
- set_meta_filters(args)
7
- end
8
- end
9
3
 
10
4
  describe Searchable do
11
5
 
@@ -1,4 +1,5 @@
1
1
  Rails.application.routes.draw do
2
- # mount MorseSearchable::Engine
3
-
2
+ # resources :fakes, concerns: :searchable
3
+
4
+
4
5
  end
data/spec/rails_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # This file is copied to spec/ when you run 'rails generate rspec:install'
2
2
  ENV['RAILS_ENV'] ||= 'test'
3
- require File.expand_path('../../config/environment', __FILE__)
3
+ require File.expand_path('../dummy/config/environment', __FILE__)
4
4
  # Prevent database truncation if the environment is production
5
5
  abort("The Rails environment is running in production mode!") if Rails.env.production?
6
6
  require 'spec_helper'
@@ -24,7 +24,6 @@ require 'rspec/rails'
24
24
 
25
25
  # Checks for pending migrations before tests are run.
26
26
  # If you are not using ActiveRecord, you can remove this line.
27
- ActiveRecord::Migration.maintain_test_schema!
28
27
 
29
28
  RSpec.configure do |config|
30
29
  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
@@ -0,0 +1,21 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe "FakesController", type: :routing do
4
+
5
+ describe "get /fakes/feed", type: :routing do
6
+ it 'should be searchable' do
7
+ expect(get: "/fakes/feed").to route_to(
8
+ controller: "fakes",
9
+ action: 'feed',
10
+ )
11
+ end
12
+ end
13
+ describe "get /fakes/filters", type: :routing do
14
+ it 'should be filterable' do
15
+ expect(get: "/fakes/filters").to route_to(
16
+ controller: "fakes",
17
+ action: 'filters',
18
+ )
19
+ end
20
+ end
21
+ end
data/spec/spec_helper.rb CHANGED
@@ -21,6 +21,16 @@ require 'shoulda/matchers'
21
21
  Dir["./spec/support/**/*.rb"].sort.each {|f| require f}
22
22
 
23
23
  Dir[File.expand_path("../support/**/*.rb",__FILE__)].each {|f| require f}
24
+
25
+
26
+ class FakesController < ActionController::Base
27
+ include Searchable
28
+
29
+ def set_meta_filters_here(args={})
30
+ set_meta_filters(args)
31
+ end
32
+ end
33
+
24
34
  class Thing
25
35
  def self.all
26
36
  []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morse_searchable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - fredmcgroarty
@@ -167,6 +167,7 @@ files:
167
167
  - lib/morse_searchable.rb
168
168
  - lib/morse_searchable/engine.rb
169
169
  - lib/morse_searchable/version.rb
170
+ - lib/searchable_routing_concern.rb
170
171
  - lib/tasks/morse_searchable_tasks.rake
171
172
  - spec/controllers/searchable_spec.rb
172
173
  - spec/dummy/README.rdoc
@@ -204,6 +205,7 @@ files:
204
205
  - spec/dummy/public/500.html
205
206
  - spec/dummy/public/favicon.ico
206
207
  - spec/rails_helper.rb
208
+ - spec/routing/concern_routing_spec.rb
207
209
  - spec/spec_helper.rb
208
210
  homepage:
209
211
  licenses:
@@ -266,4 +268,5 @@ test_files:
266
268
  - spec/dummy/Rakefile
267
269
  - spec/dummy/README.rdoc
268
270
  - spec/rails_helper.rb
271
+ - spec/routing/concern_routing_spec.rb
269
272
  - spec/spec_helper.rb