Skip to content

Commit

Permalink
[ci] Do not test nokogiri validation line numbers
Browse files Browse the repository at this point in the history
They change depending on the nokogiri version, input and moon phase...
  • Loading branch information
hennevogel committed Oct 5, 2017
1 parent 7d24036 commit 88e5dfc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/api/spec/controllers/webui/package_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/api/test/functional/webui/package_edit_source_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/api/test/functional/webui/project_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,13 @@ def test_save_meta
xml = "<project name='home:adrian'> <title>My Home Project</title </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 = "<project name='home:adrian'><title>My Home Project</title></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")
Expand Down

0 comments on commit 88e5dfc

Please sign in to comment.