mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 23:07:28 +08:00
Stop writing to STDOUT/ERR during tests
This commit is contained in:
@ -60,7 +60,7 @@ RSpec.describe ColumnDropper do
|
|||||||
VALUES (1, 'something@email.com');
|
VALUES (1, 'something@email.com');
|
||||||
SQL
|
SQL
|
||||||
|
|
||||||
described_class.mark_readonly(table_name, 'email')
|
ColumnDropper.mark_readonly(table_name, 'email')
|
||||||
end
|
end
|
||||||
|
|
||||||
after do
|
after do
|
||||||
@ -74,7 +74,7 @@ RSpec.describe ColumnDropper do
|
|||||||
|
|
||||||
it 'should prevent updates to the readonly column' do
|
it 'should prevent updates to the readonly column' do
|
||||||
expect do
|
expect do
|
||||||
ActiveRecord::Base.exec_sql <<~SQL
|
ActiveRecord::Base.connection.raw_connection.exec <<~SQL
|
||||||
UPDATE #{table_name}
|
UPDATE #{table_name}
|
||||||
SET email = 'testing@email.com'
|
SET email = 'testing@email.com'
|
||||||
WHERE topic_id = 1;
|
WHERE topic_id = 1;
|
||||||
@ -99,7 +99,7 @@ RSpec.describe ColumnDropper do
|
|||||||
|
|
||||||
it 'should prevent insertions to the readonly column' do
|
it 'should prevent insertions to the readonly column' do
|
||||||
expect do
|
expect do
|
||||||
ActiveRecord::Base.exec_sql <<~SQL
|
ActiveRecord::Base.connection.raw_connection.exec <<~SQL
|
||||||
INSERT INTO #{table_name} (topic_id, email)
|
INSERT INTO #{table_name} (topic_id, email)
|
||||||
VALUES (2, 'something@email.com');
|
VALUES (2, 'something@email.com');
|
||||||
SQL
|
SQL
|
||||||
|
Reference in New Issue
Block a user