squint 0.0.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.all-contributorsrc +108 -0
- data/lib/squint.rb +107 -87
- data/lib/squint/version.rb +1 -1
- data/readme.md +186 -0
- data/test/dummy/app/assets/config/manifest.js +1 -0
- data/test/dummy/app/models/post.rb +2 -0
- data/test/dummy/app/models/user.rb +6 -0
- data/test/dummy/config/application.rb +3 -1
- data/test/dummy/config/environments/test.rb +7 -2
- data/test/dummy/db/migrate/20200318185942_create_users.rb +9 -0
- data/test/dummy/db/migrate/20200318185943_add_settings_to_posts.rb +7 -0
- data/test/dummy/db/schema.rb +11 -6
- data/test/dummy/user.rb +6 -0
- data/test/squint_test.rb +43 -13
- data/test/test_helper.rb +5 -1
- metadata +33 -26
- data/test/dummy/app/models/post.rb~ +0 -2
- data/test/dummy/config/database.yml~ +0 -25
- data/test/dummy/db/migrate/20170512185941_create_posts.rb~ +0 -12
- data/test/dummy/log/development.log +0 -351
- data/test/dummy/log/test.log +0 -29428
- data/test/dummy/test/fixtures/posts.yml~ +0 -13
- data/test/dummy/test/models/post_test.rb +0 -4
- data/test/dummy/test/models/post_test.rb~ +0 -17
- data/test/test_helper.rb~ +0 -20
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class PostTest < ActiveSupport::TestCase
|
4
|
-
[:request_info, :properties].each do |prop_name|
|
5
|
-
test "generates SQL for #{prop_name}" do
|
6
|
-
sql_string = Post.where(prop_name => { referer: "http://example.com/one" } ).to_sql
|
7
|
-
puts sql_string
|
8
|
-
assert_match(/\"posts\".\"#{prop_name}\"-[>]{1,2}\'referer\'/, sql_string)
|
9
|
-
end
|
10
|
-
|
11
|
-
test "finds records for #{prop_name}" do
|
12
|
-
reln = Post.where(prop_name => { referer: "http://example.com/one" } )
|
13
|
-
puts reln.to_sql
|
14
|
-
assert_equal 1,reln.count
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/test/test_helper.rb~
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# Configure Rails Environment
|
2
|
-
ENV["RAILS_ENV"] = "test"
|
3
|
-
|
4
|
-
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
|
5
|
-
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
|
6
|
-
require "rails/test_help"
|
7
|
-
|
8
|
-
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
9
|
-
# to be shown.
|
10
|
-
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
11
|
-
|
12
|
-
# Load support files
|
13
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
14
|
-
|
15
|
-
# Load fixtures from the engine
|
16
|
-
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
17
|
-
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
18
|
-
ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
|
19
|
-
ActiveSupport::TestCase.fixtures :all
|
20
|
-
end
|