Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure on some random generated emails #4938

Open
viroulep opened this issue Dec 11, 2019 · 4 comments
Open

Test failure on some random generated emails #4938

viroulep opened this issue Dec 11, 2019 · 4 comments
Labels
TYPE: bug Bug reported by a stakeholder TYPE: test-bug Bug in tests used by WST

Comments

@viroulep
Copy link
Contributor

This popped up in one of travis' builds:

ActiveRecord::ValueTooLong:
       Mysql2::Error: Data too long for column 'submitterEmail' at row 1: INSERT INTO `CompetitionsMedia` (`competitionId`, `type`, `text`, `uri`, `submitterName`, `submitterComment`, `submitterEmail`, `timestampSubmitted`, `status`) VALUES ('FooComp6252015', 'article', 'i am from 2013 and accepted', 'https://www.example.com/article-42', 'Denis Christiansen', 'This is a comment', '[email protected]', '2019-12-07 07:43:32', 'accepted')

We should look into FactoryBot's settings to have emails below a given threshold, but most importantly we should fail registration for users with emails above what our db supports!

@viroulep viroulep added TYPE: bug Bug reported by a stakeholder TYPE: test-bug Bug in tests used by WST labels Dec 11, 2019
@viroulep
Copy link
Contributor Author

Oh and the test failed is:

rspec ./spec/requests/media_spec.rb[1:6:1:1:1] # media PATCH #update it should behave like only WCT when not signed in redirects to sign in page

@tussosedan
Copy link
Contributor

tussosedan commented Dec 13, 2019

It looks like our DB isn't consistent in the various emails column data types, is there a reason for it?

image

SELECT 
    TABLE_NAME, COLUMN_NAME, data_type, CHARACTER_MAXIMUM_LENGTH
FROM
    INFORMATION_SCHEMA.COLUMNS
WHERE
    COLUMN_NAME LIKE '%email%'
        AND TABLE_SCHEMA = 'wca_development'
        AND column_name NOT LIKE 'receive%'
        AND column_name NOT LIKE '%allow%'
        AND column_name NOT LIKE '%hash%'
        AND column_name NOT LIKE '%time%'
ORDER BY 1 , 2;

@viroulep
Copy link
Contributor Author

Just came across your reply and no, there is no particular reason for it.
While I can't tell for competitionsmedia and the archive stuff, the last 4 tables definitely should all have the same limit!

@tussosedan
Copy link
Contributor

Hmm we should probably align them at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TYPE: bug Bug reported by a stakeholder TYPE: test-bug Bug in tests used by WST
Projects
Status: No status
Development

No branches or pull requests

2 participants