fix rubocop offenses
This commit is contained in:
@ -30,6 +30,7 @@ module CrudControllerBase
|
||||
return unless prepare_crud_test :show, no_permission: true
|
||||
|
||||
get :show, params: @crud[:show_params].presence || { id: @crud[:entity].id }
|
||||
|
||||
assert_response :forbidden
|
||||
end
|
||||
|
||||
@ -78,6 +79,7 @@ module CrudControllerBase
|
||||
end
|
||||
|
||||
get :new, params: @crud[:new_params].presence || {}
|
||||
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
@ -85,6 +87,7 @@ module CrudControllerBase
|
||||
return unless prepare_crud_test :new, no_permission: true
|
||||
|
||||
get :new, params: @crud[:new_params].presence || {}
|
||||
|
||||
assert_response :forbidden
|
||||
end
|
||||
|
||||
|
@ -20,6 +20,7 @@ class AccountControllerTest < Additionals::ControllerTest
|
||||
change_plugin_settings 'additionals', account_login_bottom: 'Lore impsuum'
|
||||
|
||||
get :login
|
||||
|
||||
assert_response :success
|
||||
assert_select 'input[name=username]'
|
||||
assert_select 'input[name=password]'
|
||||
@ -30,6 +31,7 @@ class AccountControllerTest < Additionals::ControllerTest
|
||||
change_plugin_settings 'additionals', account_login_bottom: ''
|
||||
|
||||
get :login
|
||||
|
||||
assert_response :success
|
||||
assert_select 'input[name=username]'
|
||||
assert_select 'input[name=password]'
|
||||
@ -47,9 +49,11 @@ class AccountControllerTest < Additionals::ControllerTest
|
||||
firstname: 'John',
|
||||
lastname: 'Doe',
|
||||
mail: 'register@example.com' } }
|
||||
|
||||
assert_redirected_to '/my/account'
|
||||
end
|
||||
user = User.last
|
||||
|
||||
assert_equal 'register', user.login
|
||||
assert_equal 'John', user.firstname
|
||||
assert_equal 'Doe', user.lastname
|
||||
|
@ -12,6 +12,7 @@ class AdminControllerTest < Additionals::ControllerTest
|
||||
|
||||
def test_info
|
||||
get :info
|
||||
|
||||
assert_response :success
|
||||
assert_select 'table.list tr.system_info'
|
||||
end
|
||||
|
@ -19,8 +19,10 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
icon = json.first
|
||||
|
||||
assert_kind_of Hash, icon
|
||||
assert_equal 'far_address-book', icon['id']
|
||||
assert_equal 'Address Book', icon['text']
|
||||
@ -32,9 +34,11 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 5, json.count
|
||||
icon = json.first
|
||||
|
||||
assert_kind_of Hash, icon
|
||||
assert_equal 'fas_cloud-sun', icon['id']
|
||||
assert_equal 'Cloud with Sun', icon['text']
|
||||
@ -46,6 +50,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 0, json.count
|
||||
end
|
||||
@ -56,6 +61,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 2, json.count
|
||||
|
||||
@ -70,6 +76,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 3, json.count
|
||||
|
||||
@ -85,6 +92,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 2, json.count
|
||||
|
||||
@ -100,6 +108,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
|
||||
assert_equal 3, json.count
|
||||
@ -115,6 +124,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 1, json.count
|
||||
|
||||
@ -128,6 +138,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 2, json.count
|
||||
|
||||
@ -142,6 +153,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 2, json.count
|
||||
|
||||
@ -156,6 +168,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 1, json.count
|
||||
|
||||
@ -169,6 +182,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 1, json.count
|
||||
|
||||
@ -183,13 +197,16 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 1, json.count
|
||||
|
||||
children = json.first['children']
|
||||
|
||||
assert_equal 1, children.count
|
||||
|
||||
entry = children.first
|
||||
|
||||
assert_equal 2, entry['id']
|
||||
assert_equal 'John Smith', entry['text']
|
||||
assert_equal 'John Smith', entry['name']
|
||||
@ -203,6 +220,7 @@ class AutoCompletesControllerTest < Additionals::ControllerTest
|
||||
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode response.body
|
||||
|
||||
assert_kind_of Array, json
|
||||
assert_equal 1, json.count
|
||||
|
||||
|
@ -92,6 +92,7 @@ class IssuesControllerTest < Additionals::ControllerTest
|
||||
@request.session[:user_id] = 2
|
||||
get :show,
|
||||
params: { id: 2 }
|
||||
|
||||
assert_select 'a.assign-to-me', count: 0
|
||||
end
|
||||
end
|
||||
@ -101,6 +102,7 @@ class IssuesControllerTest < Additionals::ControllerTest
|
||||
@request.session[:user_id] = 2
|
||||
get :show,
|
||||
params: { id: 4 }
|
||||
|
||||
assert_select 'a.assign-to-me', count: 0
|
||||
end
|
||||
end
|
||||
@ -110,6 +112,7 @@ class IssuesControllerTest < Additionals::ControllerTest
|
||||
@request.session[:user_id] = 2
|
||||
get :show,
|
||||
params: { id: 2 }
|
||||
|
||||
assert_select 'ul.issue-status-change-sidebar'
|
||||
end
|
||||
end
|
||||
@ -119,6 +122,7 @@ class IssuesControllerTest < Additionals::ControllerTest
|
||||
@request.session[:user_id] = 2
|
||||
get :show,
|
||||
params: { id: 2 }
|
||||
|
||||
assert_select 'ul.issue-status-change-sidebar', count: 0
|
||||
end
|
||||
end
|
||||
@ -178,6 +182,7 @@ class IssuesControllerTest < Additionals::ControllerTest
|
||||
with_plugin_settings 'additionals', new_ticket_message: 'blub' do
|
||||
@request.session[:user_id] = 2
|
||||
get :new, params: { project_id: 1 }
|
||||
|
||||
assert_select '.new-ticket-message'
|
||||
end
|
||||
end
|
||||
@ -190,6 +195,7 @@ class IssuesControllerTest < Additionals::ControllerTest
|
||||
with_plugin_settings 'additionals', new_ticket_message: 'blub' do
|
||||
@request.session[:user_id] = 2
|
||||
get :new, params: { project_id: 1 }
|
||||
|
||||
assert_select '.new-ticket-message', count: 0
|
||||
end
|
||||
end
|
||||
|
@ -42,6 +42,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'iframe[src=?]', '//www.youtube-nocookie.com/embed/KMU0tzLwhbE'
|
||||
end
|
||||
@ -52,6 +53,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'iframe', src: %r{^https://www\.meteoblue\.com/en/weather/widget/daily/(.*)}
|
||||
end
|
||||
@ -62,6 +64,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'iframe[src=?]', '//player.vimeo.com/video/142849533'
|
||||
end
|
||||
@ -72,6 +75,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'iframe[src=?]', '//www.slideshare.net/slideshow/embed_code/57941706'
|
||||
end
|
||||
@ -82,6 +86,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'iframe[src=?]', 'https://docs.google.com/spreadsheets/d/e/RANDOMCODE/pubhtml?widget=true&headers=false'
|
||||
end
|
||||
@ -92,6 +97,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'iframe[src=?]', 'https://www.redmine.org/'
|
||||
end
|
||||
@ -102,6 +108,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'a.twitter'
|
||||
assert_select 'a[href=?]', 'https://twitter.com/alphanodes',
|
||||
@ -111,6 +118,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_select 'a.twitter'
|
||||
assert_select 'a[href=?]', 'https://twitter.com/alphanodes',
|
||||
text: '@alphanodes'
|
||||
@ -119,6 +127,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_select 'a.twitter'
|
||||
assert_select 'a[href=?]', 'https://twitter.com/hashtag/alphanodes',
|
||||
text: '#alphanodes'
|
||||
@ -130,6 +139,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'a.reddit'
|
||||
assert_select 'a[href=?]', 'https://www.reddit.com/r/redmine',
|
||||
@ -139,6 +149,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_select 'a.reddit'
|
||||
assert_select 'a[href=?]', 'https://www.reddit.com/username/redmine',
|
||||
text: 'u/redmine'
|
||||
@ -147,6 +158,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_select 'a.reddit'
|
||||
assert_select 'a[href=?]', 'https://www.reddit.com/r/redmine',
|
||||
text: 'r/redmine'
|
||||
@ -158,6 +170,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'span.last-updated-by'
|
||||
assert_select 'a[href=?]', '/users/2',
|
||||
@ -170,6 +183,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'span.last-updated-at'
|
||||
assert_select 'a[href=?]', '/projects/ecookbook/activity'
|
||||
@ -181,6 +195,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div.recently-updated'
|
||||
end
|
||||
@ -191,6 +206,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div.wiki div.user'
|
||||
end
|
||||
@ -201,6 +217,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div.wiki a.macro-new-issue'
|
||||
end
|
||||
@ -211,6 +228,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div.wiki div.user'
|
||||
end
|
||||
@ -221,6 +239,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div.wiki div.additionals-projects tr.project'
|
||||
end
|
||||
@ -231,6 +250,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'i.fas.fa-adjust'
|
||||
end
|
||||
@ -241,6 +261,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'a[href=?]', 'https://www.redmine.org/issues/12066'
|
||||
end
|
||||
@ -251,6 +272,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'a[href=?]', 'https://www.redmine.org/issues/12066'
|
||||
end
|
||||
@ -261,6 +283,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'a[href=?]', 'https://www.redmine.org/projects/redmine/wiki/RedmineInstall'
|
||||
end
|
||||
@ -271,6 +294,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'a[href=?]', 'https://www.redmine.org/projects/redmine/wiki/RedmineInstall'
|
||||
end
|
||||
@ -281,6 +305,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'script[src=?]', 'https://gist.github.com/plentz/6737338.js'
|
||||
end
|
||||
@ -291,6 +316,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'script[src=?]', 'https://s3.tradingview.com/tv.js'
|
||||
end
|
||||
@ -301,6 +327,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div.wiki div.cryptocompare',
|
||||
text: %r{https://widgets\.cryptocompare\.com/serve/v3/coin/header\?fsyms=BTC,ETH&tsyms=EUR}
|
||||
@ -374,6 +401,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'script[src=?]', '//asciinema.org/a/113463.js'
|
||||
end
|
||||
@ -384,6 +412,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select '#content a.user.active[href=?]', '/users/2',
|
||||
text: 'John Smith'
|
||||
@ -395,6 +424,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select '#content span.user.active', text: 'John Smith'
|
||||
end
|
||||
@ -405,6 +435,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select '#content a[href=?]', '/users/1',
|
||||
text: 'Redmine Admin'
|
||||
@ -416,6 +447,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select '#content a.user', text: 'Redmine Admin'
|
||||
assert_select '#content a[href=?]', '/users/1',
|
||||
@ -428,6 +460,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select '#content a[href=?]', '/users/2',
|
||||
text: 'John Smith'
|
||||
@ -439,6 +472,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
|
||||
assert_response :success
|
||||
assert_select '#content a.user', text: 'John Smith'
|
||||
assert_select '#content a[href=?]', '/users/2',
|
||||
|
@ -86,6 +86,7 @@ module Additionals
|
||||
|
||||
spec = +"td.#{c}"
|
||||
spec << "[colspan='#{colspan}']" if colspan
|
||||
|
||||
assert_select spec
|
||||
end
|
||||
|
||||
|
@ -27,6 +27,7 @@ module ApiTest
|
||||
|
||||
test 'GET /issues.xml should contain metadata' do
|
||||
get '/issues.xml'
|
||||
|
||||
assert_select 'issues[type=array][total_count][limit="25"][offset="0"]'
|
||||
end
|
||||
|
||||
@ -61,6 +62,7 @@ module ApiTest
|
||||
headers: { 'CONTENT_TYPE' => 'application/xml' }.merge(credentials('jsmith'))
|
||||
end
|
||||
issue = Issue.last
|
||||
|
||||
assert_equal 1, issue.project_id
|
||||
assert_nil issue.assigned_to_id
|
||||
assert_equal 'API test', issue.subject
|
||||
@ -91,6 +93,7 @@ module ApiTest
|
||||
end
|
||||
|
||||
issue = Issue.last
|
||||
|
||||
assert_equal 1, issue.project_id
|
||||
assert_equal 2, issue.assigned_to_id
|
||||
assert_equal 'API test', issue.subject
|
||||
@ -108,6 +111,7 @@ module ApiTest
|
||||
assert_response :success
|
||||
assert_empty response.body
|
||||
end
|
||||
|
||||
assert_nil Issue.find_by(id: 6)
|
||||
end
|
||||
end
|
||||
|
@ -19,6 +19,7 @@ module ApiTest
|
||||
test 'GET /projects.xml should return projects' do
|
||||
get '/projects.xml',
|
||||
headers: credentials('jsmith')
|
||||
|
||||
assert_response :success
|
||||
assert_equal 'application/xml', @response.media_type
|
||||
|
||||
|
@ -25,6 +25,7 @@ class CommonViewsTest < Additionals::IntegrationTest
|
||||
test 'View user' do
|
||||
log_user 'admin', 'admin'
|
||||
get '/users/2'
|
||||
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
@ -35,6 +36,7 @@ class CommonViewsTest < Additionals::IntegrationTest
|
||||
issue.description = 'new value'
|
||||
issue.save
|
||||
get '/issues/1'
|
||||
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
@ -20,10 +20,12 @@ class AdditionalsFontAwesomeTest < Additionals::TestCase
|
||||
|
||||
def test_value_info_should_return_infos
|
||||
info = AdditionalsFontAwesome.value_info 'invalid'
|
||||
|
||||
assert info.is_a? Hash
|
||||
assert_empty info
|
||||
|
||||
info = AdditionalsFontAwesome.value_info 'fas_car'
|
||||
|
||||
assert info.key?(:classes)
|
||||
assert_equal :fas, info[:type]
|
||||
assert_equal 'fas fa-car', info[:classes]
|
||||
@ -32,6 +34,7 @@ class AdditionalsFontAwesomeTest < Additionals::TestCase
|
||||
|
||||
def test_value_info_regular_icons
|
||||
info = AdditionalsFontAwesome.value_info 'far_address-book'
|
||||
|
||||
assert info.key?(:classes)
|
||||
assert_equal 'normal', info[:font_weight]
|
||||
assert_equal 'Font Awesome\ 5 Free', info[:font_family]
|
||||
@ -39,6 +42,7 @@ class AdditionalsFontAwesomeTest < Additionals::TestCase
|
||||
|
||||
def test_value_info_solid_icons
|
||||
info = AdditionalsFontAwesome.value_info 'fas_address-book'
|
||||
|
||||
assert info.key?(:classes)
|
||||
assert_equal 900, info[:font_weight]
|
||||
assert_equal 'Font Awesome\ 5 Free', info[:font_family]
|
||||
@ -46,6 +50,7 @@ class AdditionalsFontAwesomeTest < Additionals::TestCase
|
||||
|
||||
def test_value_info_brands_icons
|
||||
info = AdditionalsFontAwesome.value_info 'fab_xing'
|
||||
|
||||
assert info.key?(:classes)
|
||||
assert_equal 'normal', info[:font_weight]
|
||||
assert_equal 'Font Awesome\ 5 Brands', info[:font_family]
|
||||
@ -53,6 +58,7 @@ class AdditionalsFontAwesomeTest < Additionals::TestCase
|
||||
|
||||
def test_brands_icon_with_details
|
||||
info = AdditionalsFontAwesome.value_info 'fab_amazon', with_details: true
|
||||
|
||||
assert info.key?(:unicode)
|
||||
assert info.key?(:label)
|
||||
assert_equal '', info[:unicode]
|
||||
@ -61,6 +67,7 @@ class AdditionalsFontAwesomeTest < Additionals::TestCase
|
||||
|
||||
def test_regular_icon_with_details
|
||||
info = AdditionalsFontAwesome.value_info 'far_calendar', with_details: true
|
||||
|
||||
assert info.key?(:unicode)
|
||||
assert info.key?(:label)
|
||||
assert_equal '', info[:unicode]
|
||||
@ -69,6 +76,7 @@ class AdditionalsFontAwesomeTest < Additionals::TestCase
|
||||
|
||||
def test_solid_icon_with_details
|
||||
info = AdditionalsFontAwesome.value_info 'fas_archive', with_details: true
|
||||
|
||||
assert info.key?(:unicode)
|
||||
assert info.key?(:label)
|
||||
assert_equal '', info[:unicode]
|
||||
|
@ -5,18 +5,21 @@ require File.expand_path '../../test_helper', __FILE__
|
||||
class AdditionalsInfoTest < Additionals::TestCase
|
||||
def test_system_infos
|
||||
infos = AdditionalsInfo.new.system_infos
|
||||
|
||||
assert infos.is_a? Hash
|
||||
assert infos.count >= 3
|
||||
end
|
||||
|
||||
def test_system_info
|
||||
text = AdditionalsInfo.new.system_info
|
||||
|
||||
assert_not_empty text
|
||||
assert_not_equal 'unknown', text
|
||||
end
|
||||
|
||||
def test_system_uptime
|
||||
info = AdditionalsInfo.new.system_uptime
|
||||
|
||||
assert info.present?
|
||||
end
|
||||
end
|
||||
|
@ -28,11 +28,13 @@ class AdditionalsMacroTest < Additionals::TestCase
|
||||
|
||||
def test_all_with_only_names
|
||||
available_macros = AdditionalsMacro.all only_names: true
|
||||
|
||||
assert_includes available_macros, 'child_pages'
|
||||
end
|
||||
|
||||
def test_with_filter
|
||||
available_macros = AdditionalsMacro.all filtered: ['child_pages'], only_names: true
|
||||
|
||||
assert_not_includes available_macros, 'child_pages'
|
||||
|
||||
for_two_macros_selection = @all_macros - %w[child_pages collapse] + ['', 'nonexistingmacro']
|
||||
@ -44,14 +46,17 @@ class AdditionalsMacroTest < Additionals::TestCase
|
||||
|
||||
def test_with_filter_all
|
||||
available_macros = AdditionalsMacro.all filtered: @all_macros, only_names: true
|
||||
|
||||
assert_equal 0, available_macros.count
|
||||
end
|
||||
|
||||
def test_with_controller_limit
|
||||
available_macros = AdditionalsMacro.all only_names: true, controller_only: 'issue'
|
||||
|
||||
assert_not_includes available_macros, 'child_pages'
|
||||
|
||||
available_macros = AdditionalsMacro.all only_names: true, controller_only: 'wiki'
|
||||
|
||||
assert_includes available_macros, 'child_pages'
|
||||
end
|
||||
end
|
||||
|
@ -63,6 +63,7 @@ class DashboardTest < Additionals::TestCase
|
||||
author_id: 2,
|
||||
visibility: Dashboard::VISIBILITY_ROLES,
|
||||
roles: [used_role]
|
||||
|
||||
assert_save dashboard
|
||||
dashboard.reload
|
||||
|
||||
@ -85,6 +86,7 @@ class DashboardTest < Additionals::TestCase
|
||||
system_default: true,
|
||||
author: User.current,
|
||||
visibility: 2
|
||||
|
||||
assert_save dashboard
|
||||
|
||||
assert dashboard.system_default
|
||||
@ -97,6 +99,7 @@ class DashboardTest < Additionals::TestCase
|
||||
system_default: true,
|
||||
author: User.current,
|
||||
visibility: 2
|
||||
|
||||
assert dashboard.valid?
|
||||
|
||||
assert_save dashboard
|
||||
@ -137,6 +140,7 @@ class DashboardTest < Additionals::TestCase
|
||||
assert dashboard.valid?
|
||||
|
||||
dashboard.visibility = 0
|
||||
|
||||
assert_not dashboard.valid?
|
||||
end
|
||||
|
||||
@ -147,9 +151,11 @@ class DashboardTest < Additionals::TestCase
|
||||
project_id: nil,
|
||||
author: User.current,
|
||||
visibility: 2)
|
||||
|
||||
assert dashboard.valid?
|
||||
|
||||
dashboard.visibility = 0
|
||||
|
||||
assert_not dashboard.valid?
|
||||
end
|
||||
|
||||
@ -176,16 +182,20 @@ class DashboardTest < Additionals::TestCase
|
||||
visibility: 2)
|
||||
|
||||
dashboard.name = 'Only for user 2'
|
||||
|
||||
assert dashboard.valid?
|
||||
|
||||
dashboard.project_id = 1
|
||||
dashboard.name = 'Private project for user 2'
|
||||
|
||||
assert_not dashboard.valid?
|
||||
dashboard.name = 'Only for me - new'
|
||||
|
||||
assert dashboard.valid?
|
||||
|
||||
dashboard.name = 'Only for me - new'
|
||||
dashboard.project_id = 2
|
||||
|
||||
assert dashboard.valid?
|
||||
end
|
||||
|
||||
@ -199,6 +209,7 @@ class DashboardTest < Additionals::TestCase
|
||||
|
||||
def test_destroy_dashboard_without_roles
|
||||
dashboard = dashboards :private_welcome2
|
||||
|
||||
assert dashboard.roles.none?
|
||||
assert dashboard.deletable?(users(:users_002))
|
||||
assert_difference 'Dashboard.count', -1 do
|
||||
@ -208,22 +219,28 @@ class DashboardTest < Additionals::TestCase
|
||||
|
||||
def test_create_dashboard_roles_relation
|
||||
dashboard = dashboards :welcome_for_roles
|
||||
|
||||
assert_equal 2, dashboard.roles.count
|
||||
|
||||
relation = DashboardRole.new role_id: 3, dashboard_id: dashboard.id
|
||||
|
||||
assert_save relation
|
||||
|
||||
dashboard.reload
|
||||
|
||||
assert_equal 3, dashboard.roles.count
|
||||
end
|
||||
|
||||
def test_create_dashboard_roles_relation_with_autosave
|
||||
dashboard = dashboards :welcome_for_roles
|
||||
|
||||
assert_equal 2, dashboard.roles.count
|
||||
|
||||
dashboard.roles << Role.generate!
|
||||
|
||||
assert_save dashboard
|
||||
dashboard.reload
|
||||
|
||||
assert_equal 3, dashboard.roles.count
|
||||
end
|
||||
|
||||
@ -233,6 +250,7 @@ class DashboardTest < Additionals::TestCase
|
||||
# change system default
|
||||
dashboard2 = dashboards :public_welcome
|
||||
dashboard2.system_default = true
|
||||
|
||||
assert_save dashboard2
|
||||
|
||||
dashboard = dashboards :welcome_for_roles
|
||||
@ -251,6 +269,7 @@ class DashboardTest < Additionals::TestCase
|
||||
|
||||
def test_disable_welcome_system_default_on_system_default_dashboard_should_not_possible
|
||||
dashboard = dashboards :system_default_welcome
|
||||
|
||||
assert dashboard.system_default
|
||||
|
||||
dashboard.system_default = false
|
||||
@ -281,15 +300,18 @@ class DashboardTest < Additionals::TestCase
|
||||
dashboard = dashboards :private_project_default
|
||||
|
||||
dashboard.project_id = 1
|
||||
|
||||
assert_save dashboard
|
||||
end
|
||||
|
||||
def test_dashboard_name_should_strip_spaces
|
||||
dashboard = dashboards :system_default_welcome
|
||||
dashboard.name = ' new name '
|
||||
|
||||
assert_save dashboard
|
||||
|
||||
dashboard.reload
|
||||
|
||||
assert_equal 'new name', dashboard.name
|
||||
end
|
||||
|
||||
|
@ -21,6 +21,7 @@ class EntityMethodTest < Additionals::TestCase
|
||||
def test_allowed_entity_target_projects
|
||||
projects = Dashboard.allowed_entity_target_projects permission: :save_dashboards,
|
||||
user: users(:users_002)
|
||||
|
||||
assert_sorted_equal [1, 2, 5], projects.ids
|
||||
end
|
||||
|
||||
@ -36,6 +37,7 @@ class EntityMethodTest < Additionals::TestCase
|
||||
projects = Dashboard.allowed_entity_target_projects permission: :save_dashboards,
|
||||
user: users(:users_002),
|
||||
exclude: projects(:projects_005)
|
||||
|
||||
assert_sorted_equal [1, 2], projects.ids
|
||||
end
|
||||
|
||||
@ -44,6 +46,7 @@ class EntityMethodTest < Additionals::TestCase
|
||||
user: users(:users_002),
|
||||
project: projects(:projects_003),
|
||||
exclude: projects(:projects_005)
|
||||
|
||||
assert_sorted_equal [1, 2, 3], projects.ids
|
||||
end
|
||||
end
|
||||
|
@ -37,15 +37,19 @@ class GlobalHelperTest < Redmine::HelperTest
|
||||
|
||||
def test_font_awesome_icon
|
||||
html = font_awesome_icon 'fas_cloud-upload-alt', class: 'test'
|
||||
|
||||
assert_include 'class="fas fa-cloud-upload-alt test"', html
|
||||
|
||||
html = font_awesome_icon 'fab_xing', class: 'test'
|
||||
|
||||
assert_include 'class="fab fa-xing test"', html
|
||||
|
||||
html = font_awesome_icon 'fas_cloud-upload-alt', pre_text: 'Testing'
|
||||
|
||||
assert_include 'Testing <span', html
|
||||
|
||||
html = font_awesome_icon 'fas_cloud-upload-alt', post_text: 'Testing'
|
||||
|
||||
assert_include '</span> Testing', html
|
||||
end
|
||||
|
||||
|
@ -21,13 +21,16 @@ class I18nTest < Additionals::TestCase
|
||||
|
||||
def test_locales_validness
|
||||
lang_files_count = Dir[Rails.root.join('plugins/additionals/config/locales/*.yml')].size
|
||||
|
||||
assert_equal 13, lang_files_count
|
||||
valid_languages.each do |lang|
|
||||
assert set_language_if_valid(lang)
|
||||
case lang.to_s
|
||||
when 'en'
|
||||
|
||||
assert_equal 'Open external URLs', l(:label_open_external_urls)
|
||||
when 'pt-BR', 'cs', 'de', 'es', 'fr', 'it', 'ja', 'ko', 'po', 'ru', 'zh-TW', 'zh'
|
||||
|
||||
assert_not l(:label_open_external_urls) == 'Open external URLs', lang
|
||||
end
|
||||
end
|
||||
|
@ -25,6 +25,7 @@ class IssueTest < Additionals::TestCase
|
||||
|
||||
def test_create
|
||||
issue = Issue.new project_id: 1, tracker_id: 1, author_id: 3, subject: 'test_create'
|
||||
|
||||
assert_save issue
|
||||
assert_equal issue.tracker.default_status, issue.status
|
||||
assert_nil issue.description
|
||||
@ -35,6 +36,7 @@ class IssueTest < Additionals::TestCase
|
||||
User.current = users :users_003
|
||||
issue = issues :issues_007
|
||||
issue.subject = 'Should be be saved'
|
||||
|
||||
assert_save issue
|
||||
end
|
||||
end
|
||||
@ -50,9 +52,11 @@ class IssueTest < Additionals::TestCase
|
||||
issue = issues :issues_008
|
||||
|
||||
issue.subject = 'Should be saved'
|
||||
|
||||
assert_save issue
|
||||
|
||||
issue.reload
|
||||
|
||||
assert_equal 'Should be saved', issue.subject
|
||||
end
|
||||
end
|
||||
@ -64,11 +68,14 @@ class IssueTest < Additionals::TestCase
|
||||
|
||||
assert issue.closed?
|
||||
issue.subject = 'Should be not be saved'
|
||||
|
||||
assert_not issue.save
|
||||
issue.reload
|
||||
|
||||
assert_not_equal 'Should be not be saved', issue.subject
|
||||
|
||||
issue.status_id = 1
|
||||
|
||||
assert issue.status_was.is_closed
|
||||
assert_not issue.closed?
|
||||
assert_not issue.save
|
||||
@ -81,10 +88,12 @@ class IssueTest < Additionals::TestCase
|
||||
|
||||
issue = Issue.generate subject: 'new issue for closing test',
|
||||
status_id: 1
|
||||
|
||||
assert_save issue
|
||||
|
||||
issue = Issue.generate subject: 'new issue for closing test and closed state',
|
||||
status_id: 5
|
||||
|
||||
assert_save issue
|
||||
end
|
||||
end
|
||||
@ -95,9 +104,11 @@ class IssueTest < Additionals::TestCase
|
||||
issue = issues :issues_008
|
||||
|
||||
issue.subject = 'Should be saved'
|
||||
|
||||
assert_save issue
|
||||
|
||||
issue.reload
|
||||
|
||||
assert_equal 'Should be saved', issue.subject
|
||||
end
|
||||
end
|
||||
@ -106,10 +117,12 @@ class IssueTest < Additionals::TestCase
|
||||
with_plugin_settings 'additionals', issue_freezed_with_close: 1 do
|
||||
User.current = users :users_003
|
||||
issue = issues :issues_008
|
||||
|
||||
assert_save issue
|
||||
|
||||
# but changed issues should throw error
|
||||
issue.subject = 'changed'
|
||||
|
||||
assert_not issue.save
|
||||
end
|
||||
end
|
||||
@ -119,6 +132,7 @@ class IssueTest < Additionals::TestCase
|
||||
issue_auto_assign_status: ['1'],
|
||||
issue_auto_assign_role: '1' do
|
||||
issue = Issue.new project_id: 1, tracker_id: 1, author_id: 3, subject: 'test_create'
|
||||
|
||||
assert_save issue
|
||||
assert_equal 2, issue.assigned_to_id
|
||||
end
|
||||
@ -129,6 +143,7 @@ class IssueTest < Additionals::TestCase
|
||||
issue_auto_assign_status: ['1'],
|
||||
issue_auto_assign_role: '1' do
|
||||
issue = Issue.new project_id: 1, tracker_id: 1, author_id: 3, subject: 'test_create'
|
||||
|
||||
assert_save issue
|
||||
assert_nil issue.assigned_to_id
|
||||
end
|
||||
@ -137,6 +152,7 @@ class IssueTest < Additionals::TestCase
|
||||
issue_auto_assign_status: [],
|
||||
issue_auto_assign_role: '1' do
|
||||
issue = Issue.new project_id: 1, tracker_id: 1, author_id: 3, subject: 'test_create'
|
||||
|
||||
assert_save issue
|
||||
assert_nil issue.assigned_to_id
|
||||
end
|
||||
@ -145,6 +161,7 @@ class IssueTest < Additionals::TestCase
|
||||
issue_auto_assign_status: ['1'],
|
||||
issue_auto_assign_role: '' do
|
||||
issue = Issue.new project_id: 1, tracker_id: 1, author_id: 3, subject: 'test_create'
|
||||
|
||||
assert_save issue
|
||||
assert_nil issue.assigned_to_id
|
||||
end
|
||||
|
@ -29,21 +29,25 @@ class ProjectTest < Additionals::TestCase
|
||||
def test_assignable_users_amount
|
||||
with_settings issue_group_assignment: '1' do
|
||||
project = Project.find 5
|
||||
|
||||
assert_equal project.assignable_users.count, project.assignable_principals.count
|
||||
end
|
||||
with_settings issue_group_assignment: '0' do
|
||||
project = Project.find 5
|
||||
|
||||
assert_not_equal project.assignable_users.count, project.assignable_principals.count
|
||||
end
|
||||
end
|
||||
|
||||
def test_visible_users
|
||||
project = projects :projects_005
|
||||
|
||||
assert_equal 3, project.visible_users.count
|
||||
end
|
||||
|
||||
def test_visible_principals
|
||||
project = projects :projects_005
|
||||
|
||||
assert_equal 4, project.visible_principals.count
|
||||
end
|
||||
|
||||
@ -68,6 +72,7 @@ class ProjectTest < Additionals::TestCase
|
||||
|
||||
assert_kind_of Hash, principals_by_role
|
||||
role = Role.find 1
|
||||
|
||||
assert_kind_of Array, principals_by_role[role]
|
||||
assert_includes principals_by_role[role], User.find(2)
|
||||
end
|
||||
@ -80,10 +85,12 @@ class ProjectTest < Additionals::TestCase
|
||||
|
||||
# User.current = User.find 2
|
||||
principals_by_role = Project.find(1).principals_by_role
|
||||
|
||||
assert_equal 1, principals_by_role.count
|
||||
|
||||
User.current = User.find 1
|
||||
principals_by_role = Project.find(1).principals_by_role
|
||||
|
||||
assert_equal 2, principals_by_role.count
|
||||
end
|
||||
|
||||
@ -116,6 +123,7 @@ class ProjectTest < Additionals::TestCase
|
||||
|
||||
def test_consider_hidden_roles_without_hide_roles
|
||||
project = projects :projects_001
|
||||
|
||||
assert_not project.consider_hidden_roles?
|
||||
end
|
||||
|
||||
|
@ -101,6 +101,7 @@ class RedminePluginKitLoaderTest < Additionals::TestCase
|
||||
|
||||
def test_apply_without_data
|
||||
loader = RedminePluginKit::Loader.new plugin_id: @plugin_id
|
||||
|
||||
assert loader.apply!
|
||||
end
|
||||
|
||||
@ -109,6 +110,7 @@ class RedminePluginKitLoaderTest < Additionals::TestCase
|
||||
loader.add_helper 'Settings'
|
||||
loader.add_patch 'Issue'
|
||||
loader.add_global_helper Additionals::Helpers
|
||||
|
||||
assert loader.apply!
|
||||
end
|
||||
|
||||
@ -134,11 +136,13 @@ class RedminePluginKitLoaderTest < Additionals::TestCase
|
||||
|
||||
def test_load_model_hooks
|
||||
hooks = RedminePluginKit::Loader.new(plugin_id: @plugin_id).load_model_hooks!
|
||||
|
||||
assert hooks.is_a? Module
|
||||
end
|
||||
|
||||
def test_load_hooks
|
||||
hooks = RedminePluginKit::Loader.new(plugin_id: @plugin_id).load_view_hooks!
|
||||
|
||||
assert hooks.is_a? Module
|
||||
end
|
||||
|
||||
|
@ -14,24 +14,30 @@ class RoleTest < Additionals::TestCase
|
||||
|
||||
def test_with_permission
|
||||
role = Role.new name: 'role without hide'
|
||||
|
||||
assert_save role
|
||||
|
||||
role.reload
|
||||
|
||||
assert_not role.hide
|
||||
|
||||
role = Role.new name: 'role with hide', hide: true
|
||||
|
||||
assert_save role
|
||||
|
||||
role.reload
|
||||
|
||||
assert role.hide
|
||||
end
|
||||
|
||||
def test_edit
|
||||
role = roles :roles_001
|
||||
role.hide = true
|
||||
|
||||
assert_save role
|
||||
|
||||
role.reload
|
||||
|
||||
assert role.hide
|
||||
end
|
||||
end
|
||||
|
@ -23,12 +23,14 @@ class TimeEntryTest < Additionals::TestCase
|
||||
|
||||
def test_create_time_entry_without_issue
|
||||
entry = TimeEntry.generate project: projects(:projects_001)
|
||||
|
||||
assert entry.valid?
|
||||
assert_save entry
|
||||
end
|
||||
|
||||
def test_create_time_entry_with_open_issue
|
||||
entry = TimeEntry.generate issue: issues(:issues_002)
|
||||
|
||||
assert_not entry.issue.closed?
|
||||
assert entry.valid?
|
||||
assert_save entry
|
||||
@ -38,6 +40,7 @@ class TimeEntryTest < Additionals::TestCase
|
||||
User.current = nil
|
||||
|
||||
entry = TimeEntry.generate issue: issues(:issues_008)
|
||||
|
||||
assert entry.issue.closed?
|
||||
assert_not entry.valid?
|
||||
assert_not entry.save
|
||||
@ -51,6 +54,7 @@ class TimeEntryTest < Additionals::TestCase
|
||||
Member.create! principal: User.current, project_id: project.id, role_ids: [role.id]
|
||||
|
||||
entry = TimeEntry.generate issue: issues(:issues_008)
|
||||
|
||||
assert entry.issue.closed?
|
||||
assert entry.valid?
|
||||
assert_save entry
|
||||
|
@ -23,6 +23,7 @@ class UserTest < Additionals::TestCase
|
||||
admin_user = User.generate! admin: true
|
||||
|
||||
users = User.visible.active.with_permission :save_dashboards
|
||||
|
||||
assert_equal 5, users.count
|
||||
assert users.exists?(id: admin_user)
|
||||
end
|
||||
@ -81,6 +82,7 @@ class UserTest < Additionals::TestCase
|
||||
user = users :users_002
|
||||
|
||||
options = { skip_pre_condition: true, project: nil }
|
||||
|
||||
assert_sorted_equal Project.where(Project.allowed_to_condition(user, :view_issues, **options)).ids,
|
||||
user.allowed_project_ids_for(:view_issues, **options)
|
||||
|
||||
|
@ -16,6 +16,7 @@ module WikiFormatting
|
||||
with_plugin_settings 'additionals', legacy_smiley_support: 1,
|
||||
emoji_support: 0 do
|
||||
text = 'A small test :) with an smilie'
|
||||
|
||||
assert_equal '<p>A small test <span class="additionals smiley smiley-smiley" title=":)"></span> with an smilie</p>',
|
||||
@formatter.new(text).to_html.strip
|
||||
end
|
||||
@ -26,6 +27,7 @@ module WikiFormatting
|
||||
emoji_support: 1,
|
||||
disable_emoji_native_support: 1 do
|
||||
text = 'A test with a :heart: emoji'
|
||||
|
||||
assert_equal '<p>A test with a <img title="heavy black heart" class="inline_emojify"' \
|
||||
" src=\"http://localhost:3000/#{Additionals::EMOJI_ASSERT_PATH}/emoji_u2764.png\" /> emoji</p>",
|
||||
@formatter.new(text).to_html.strip
|
||||
@ -37,12 +39,14 @@ module WikiFormatting
|
||||
emoji_support: 1,
|
||||
disable_emoji_native_support: 1 do
|
||||
text = ':heart: and :)'
|
||||
|
||||
assert_equal '<p><img title="heavy black heart" class="inline_emojify"' \
|
||||
" src=\"http://localhost:3000/#{Additionals::EMOJI_ASSERT_PATH}/emoji_u2764.png\" />" \
|
||||
' and <span class="additionals smiley smiley-smiley" title=":)"></span></p>',
|
||||
@formatter.new(text).to_html.strip
|
||||
|
||||
text = ' :) and :heart:'
|
||||
|
||||
assert_equal '<p><span class="additionals smiley smiley-smiley" title=":)"></span> and' \
|
||||
' <img title="heavy black heart" class="inline_emojify"' \
|
||||
" src=\"http://localhost:3000/#{Additionals::EMOJI_ASSERT_PATH}/emoji_u2764.png\" /></p>",
|
||||
|
@ -22,6 +22,7 @@ module WikiFormatting
|
||||
@to_test['A test with a :) smiley'] = 'A test with a <span class="additionals smiley smiley-smiley" title=":)"></span> smiley'
|
||||
@to_test[':) :)'] = '<span class="additionals smiley smiley-smiley" title=":)"></span>' \
|
||||
' <span class="additionals smiley smiley-smiley" title=":)"></span>'
|
||||
|
||||
assert_html_output @to_test
|
||||
end
|
||||
end
|
||||
@ -35,6 +36,7 @@ module WikiFormatting
|
||||
str = 'A test with a :heart: emoji and a :) smiley'
|
||||
@to_test[str] = 'A test with a <img title="heavy black heart" class="inline_emojify"' \
|
||||
" src=\"http://localhost:3000/#{Additionals::EMOJI_ASSERT_PATH}/emoji_u2764.png\" /> emoji and a :) smiley"
|
||||
|
||||
assert_html_output @to_test
|
||||
end
|
||||
end
|
||||
@ -52,6 +54,7 @@ module WikiFormatting
|
||||
@to_test[':) and :heart:'] = '<span class="additionals smiley smiley-smiley" title=":)"></span> and' \
|
||||
' <img title="heavy black heart" class="inline_emojify"' \
|
||||
" src=\"http://localhost:3000/#{Additionals::EMOJI_ASSERT_PATH}/emoji_u2764.png\" />"
|
||||
|
||||
assert_html_output @to_test
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user