aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-06-02 07:29:44 -0600
committerSean Griffin <sean@thoughtbot.com>2015-06-02 07:29:44 -0600
commitb6b13905e5f2c5bb1e23166c3bac13672b597b03 (patch)
treed2af7d0a2a18314acfb4e2763b613bc4f07e05b9 /activerecord
parentde412eed5858540571d738913a36ac8398d9a735 (diff)
downloadrails-b6b13905e5f2c5bb1e23166c3bac13672b597b03.tar.gz
rails-b6b13905e5f2c5bb1e23166c3bac13672b597b03.tar.bz2
rails-b6b13905e5f2c5bb1e23166c3bac13672b597b03.zip
Skip test that fails from outdated sqlite3 on travis
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/relation_test.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb
index 24ed9e6638..37d3965022 100644
--- a/activerecord/test/cases/relation_test.rb
+++ b/activerecord/test/cases/relation_test.rb
@@ -243,7 +243,13 @@ module ActiveRecord
end
def test_select_quotes_when_using_from_clause
- ensure_sqlite3_version_doesnt_include_bug
+ if sqlite3_version_includes_quoting_bug?
+ skip <<-ERROR.squish
+ You are using an outdated version of SQLite3 which has a bug in
+ quoted column names. Please update SQLite3 and rebuild the sqlite3
+ ruby gem
+ ERROR
+ end
quoted_join = ActiveRecord::Base.connection.quote_table_name("join")
selected = Post.select(:join).from(Post.select("id as #{quoted_join}")).map(&:join)
assert_equal Post.pluck(:id), selected
@@ -286,16 +292,12 @@ module ActiveRecord
private
- def ensure_sqlite3_version_doesnt_include_bug
+ def sqlite3_version_includes_quoting_bug?
if current_adapter?(:SQLite3Adapter)
selected_quoted_column_names = ActiveRecord::Base.connection.exec_query(
'SELECT "join" FROM (SELECT id AS "join" FROM posts) subquery'
).columns
- assert_equal ["join"], selected_quoted_column_names, <<-ERROR.squish
- You are using an outdated version of SQLite3 which has a bug in
- quoted column names. Please update SQLite3 and rebuild the sqlite3
- ruby gem
- ERROR
+ ["join"] != selected_quoted_column_names
end
end
end