Merge branch 'master' into moderation
This commit is contained in:
commit
7dbf8d8336
206 changed files with 25954 additions and 6516 deletions
|
@ -4,6 +4,8 @@ require "capybara/poltergeist"
|
|||
WebMock.disable_net_connect!(:allow_localhost => true)
|
||||
|
||||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
||||
ActionDispatch::SystemTesting::Server.silence_puma = true
|
||||
|
||||
driven_by :poltergeist, :screen_size => [1400, 1400]
|
||||
|
||||
def initialize(*args)
|
||||
|
|
|
@ -679,12 +679,22 @@ class TraceControllerTest < ActionController::TestCase
|
|||
post :delete, :params => { :display_name => deleted_trace_file.user.display_name, :id => deleted_trace_file.id }, :session => { :user => deleted_trace_file.user }
|
||||
assert_response :not_found
|
||||
|
||||
# Finally with a trace that we are allowed to delete
|
||||
# Now with a trace that we are allowed to delete
|
||||
post :delete, :params => { :display_name => public_trace_file.user.display_name, :id => public_trace_file.id }, :session => { :user => public_trace_file.user }
|
||||
assert_response :redirect
|
||||
assert_redirected_to :action => :list, :display_name => public_trace_file.user.display_name
|
||||
trace = Trace.find(public_trace_file.id)
|
||||
assert_equal false, trace.visible
|
||||
|
||||
# Finally with a trace that is deleted by an admin
|
||||
public_trace_file = create(:trace, :visibility => "public")
|
||||
admin = create(:administrator_user)
|
||||
|
||||
post :delete, :params => { :display_name => public_trace_file.user.display_name, :id => public_trace_file.id }, :session => { :user => admin }
|
||||
assert_response :redirect
|
||||
assert_redirected_to :action => :list, :display_name => public_trace_file.user.display_name
|
||||
trace = Trace.find(public_trace_file.id)
|
||||
assert_equal false, trace.visible
|
||||
end
|
||||
|
||||
# Check getting a specific trace through the api
|
||||
|
|
|
@ -131,6 +131,9 @@ class BrowseHelperTest < ActionView::TestCase
|
|||
|
||||
html = format_value("operator:wikidata", "Q12;Q98")
|
||||
assert_dom_equal "<a title=\"The Q12 item on Wikidata\" href=\"//www.wikidata.org/wiki/Q12?uselang=en\">Q12</a>;<a title=\"The Q98 item on Wikidata\" href=\"//www.wikidata.org/wiki/Q98?uselang=en\">Q98</a>", html
|
||||
|
||||
html = format_value("name:etymology:wikidata", "Q123")
|
||||
assert_dom_equal "<a title=\"The Q123 item on Wikidata\" href=\"//www.wikidata.org/wiki/Q123?uselang=en\">Q123</a>", html
|
||||
end
|
||||
|
||||
def test_icon_tags
|
||||
|
|
|
@ -2,7 +2,7 @@ require "coveralls"
|
|||
Coveralls.wear!("rails")
|
||||
|
||||
ENV["RAILS_ENV"] = "test"
|
||||
require File.expand_path("../../config/environment", __FILE__)
|
||||
require File.expand_path("../config/environment", __dir__)
|
||||
require "rails/test_help"
|
||||
require "webmock/minitest"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue