Commit ee144c6e by Mike Burns

Fix cucumber tests after integer -> bigint conversion

As before: use `#sql_type` instead of `#type` in the tests. The `#type` is the
category -- string, integer, datetime -- but the `#sql_type` is the storage
specifics -- `TEXT`, `VARCHAR`, `BIGINT`, `DATE. Switch to the `#sql_type` so
we can be sure it's being stored correctly.
parent 34ec355e
...@@ -84,12 +84,12 @@ end ...@@ -84,12 +84,12 @@ end
Then /^I should have attachment columns for "([^"]*)"$/ do |attachment_name| Then /^I should have attachment columns for "([^"]*)"$/ do |attachment_name|
cd(".") do cd(".") do
columns = eval(`bundle exec rails runner "puts User.columns.map{ |column| [column.name, column.type] }.inspect"`.strip) columns = eval(`bundle exec rails runner "puts User.columns.map{ |column| [column.name, column.sql_type] }.inspect"`.strip)
expect_columns = [ expect_columns = [
["#{attachment_name}_file_name", :string], ["#{attachment_name}_file_name", "varchar"],
["#{attachment_name}_content_type", :string], ["#{attachment_name}_content_type", "varchar"],
["#{attachment_name}_file_size", :bigint], ["#{attachment_name}_file_size", "bigint"],
["#{attachment_name}_updated_at", :datetime] ["#{attachment_name}_updated_at", "datetime"]
] ]
expect(columns).to include(*expect_columns) expect(columns).to include(*expect_columns)
end end
...@@ -97,12 +97,12 @@ end ...@@ -97,12 +97,12 @@ end
Then /^I should not have attachment columns for "([^"]*)"$/ do |attachment_name| Then /^I should not have attachment columns for "([^"]*)"$/ do |attachment_name|
cd(".") do cd(".") do
columns = eval(`bundle exec rails runner "puts User.columns.map{ |column| [column.name, column.type] }.inspect"`.strip) columns = eval(`bundle exec rails runner "puts User.columns.map{ |column| [column.name, column.sql_type] }.inspect"`.strip)
expect_columns = [ expect_columns = [
["#{attachment_name}_file_name", :string], ["#{attachment_name}_file_name", "varchar"],
["#{attachment_name}_content_type", :string], ["#{attachment_name}_content_type", "varchar"],
["#{attachment_name}_file_size", :bigint], ["#{attachment_name}_file_size", "bigint"],
["#{attachment_name}_updated_at", :datetime] ["#{attachment_name}_updated_at", "datetime"]
] ]
expect(columns).not_to include(*expect_columns) expect(columns).not_to include(*expect_columns)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment