From 88e5dfcefae3927c69d8008314ad2d66ee6651c4 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Fri, 29 Sep 2017 16:10:10 +0200 Subject: [PATCH] [ci] Do not test nokogiri validation line numbers They change depending on the nokogiri version, input and moon phase... --- src/api/spec/controllers/webui/package_controller_spec.rb | 4 ++-- src/api/test/functional/webui/package_edit_source_test.rb | 4 ++-- src/api/test/functional/webui/project_controller_test.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/spec/controllers/webui/package_controller_spec.rb b/src/api/spec/controllers/webui/package_controller_spec.rb index 7b04fc9cc2f..80c7f1aea5c 100644 --- a/src/api/spec/controllers/webui/package_controller_spec.rb +++ b/src/api/spec/controllers/webui/package_controller_spec.rb @@ -780,8 +780,8 @@ def remove_file_post end it do - expect(flash[:error]).to eq('Error while saving the Meta file: package validation error: 1:114: FATAL: ' + - 'Opening and ending tag mismatch: package line 1 and paaaaackage.') + expect(flash[:error]).to match(/Error while saving the Meta file: package validation error.*FATAL:/) + expect(flash[:error]).to match(/Opening and ending tag mismatch: package line 1 and paaaaackage\./) end it { expect(response).to have_http_status(:bad_request) } end diff --git a/src/api/test/functional/webui/package_edit_source_test.rb b/src/api/test/functional/webui/package_edit_source_test.rb index c7baa563d28..ffd7aeb31cf 100644 --- a/src/api/test/functional/webui/package_edit_source_test.rb +++ b/src/api/test/functional/webui/package_edit_source_test.rb @@ -71,7 +71,7 @@ def add_file(file) assert_equal expected.inspect, actual.inspect elsif file[:expect] == :error flash_message_type.must_equal :alert - flash_message.must_equal file[:flash_message] + flash_message.must_have_text(file[:flash_message]) page.must_have_text 'Add File to' elsif file[:expect] == :service flash_message.must_equal "The file '#{file[:name]}' has been successfully saved." @@ -212,7 +212,7 @@ def test_add_invalid_special_file # spec/features/webui/packages_spec.rb upload_from: :local_file, upload_path: text_path('broken_link.xml'), expect: :error, - flash_message: "Error while creating '_link' file: link validation error: 12:1: FATAL: Extra content at the end of the document." + flash_message: /Error while creating '_link' file: link validation error.*FATAL: Extra content at the end of the document\./ ) end diff --git a/src/api/test/functional/webui/project_controller_test.rb b/src/api/test/functional/webui/project_controller_test.rb index 776ecc90ca4..603f187415b 100644 --- a/src/api/test/functional/webui/project_controller_test.rb +++ b/src/api/test/functional/webui/project_controller_test.rb @@ -363,13 +363,13 @@ def test_save_meta xml = " My Home Project" page.evaluate_script("editors[0].setValue(\"#{xml}\");") click_button("Save") - find(:id, 'flash-messages').must_have_text("project validation error: 1:60: FATAL: expected '>'") + find(:id, 'flash-messages').must_have_text(/project validation error.*FATAL: expected '>'/) xml = "My Home Project" page.evaluate_script("editors[0].setValue(\"#{xml}\");") click_button("Save") find(:id, 'flash-messages'). - must_have_text("project validation error: 1:0: ERROR: Expecting an element description, got nothing") + must_have_text(/project validation error.*ERROR: Expecting an element description, got nothing/) # Trigger data reload and verify that nothing was saved click_link("Meta")