Actualizar plugin Additionals a 3.0.0
This commit is contained in:
parent
3d976f1b3b
commit
a26f5567af
399 changed files with 70374 additions and 4093 deletions
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../test_helper', __FILE__)
|
||||
require File.expand_path '../../test_helper', __FILE__
|
||||
|
||||
class WikiControllerTest < Additionals::ControllerTest
|
||||
fixtures :projects,
|
||||
|
@ -25,7 +25,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
|||
def setup
|
||||
prepare_tests
|
||||
EnabledModule.create(project_id: 1, name: 'wiki')
|
||||
@project = projects(:projects_001)
|
||||
@project = projects :projects_001
|
||||
@wiki = @project.wiki
|
||||
@page_name = 'additionals_macro_test'
|
||||
@page = @wiki.find_or_new_page(@page_name)
|
||||
|
@ -51,7 +51,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
|||
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/(.*)}
|
||||
assert_select 'iframe', src: %r{^https://www\.meteoblue\.com/en/weather/widget/daily/(.*)}
|
||||
end
|
||||
|
||||
def test_show_with_vimeo_macro
|
||||
|
@ -74,6 +74,16 @@ class WikiControllerTest < Additionals::ControllerTest
|
|||
assert_select 'iframe[src=?]', '//www.slideshare.net/slideshow/embed_code/57941706'
|
||||
end
|
||||
|
||||
def test_show_with_google_docs_macro
|
||||
@request.session[:user_id] = WIKI_MACRO_USER_ID
|
||||
@page.content.text = '{{google_docs(https://docs.google.com/spreadsheets/d/e/RANDOMCODE/pubhtml)}}'
|
||||
@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
|
||||
|
||||
def test_show_with_iframe_macro
|
||||
@request.session[:user_id] = WIKI_MACRO_USER_ID
|
||||
@page.content.text = '{{iframe(https://www.redmine.org/)}}'
|
||||
|
@ -173,16 +183,6 @@ class WikiControllerTest < Additionals::ControllerTest
|
|||
assert_select 'div.recently-updated'
|
||||
end
|
||||
|
||||
def test_show_calendar_macro
|
||||
@request.session[:user_id] = WIKI_MACRO_USER_ID
|
||||
@page.content.text = '{{calendar(year=1970, month=7)}}'
|
||||
@page.content.save!
|
||||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
assert_response :success
|
||||
assert_select 'div.month-calendar'
|
||||
end
|
||||
|
||||
def test_show_with_members_macro
|
||||
@request.session[:user_id] = WIKI_MACRO_USER_ID
|
||||
@page.content.text = '{{members}}'
|
||||
|
@ -220,7 +220,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
|||
get :show,
|
||||
params: { project_id: 1, id: @page_name }
|
||||
assert_response :success
|
||||
assert_select 'div.wiki div.additionals-projects li.project'
|
||||
assert_select 'div.wiki div.additionals-projects tr.project'
|
||||
end
|
||||
|
||||
def test_show_with_fa_macro
|
||||
|
@ -301,7 +301,7 @@ class WikiControllerTest < Additionals::ControllerTest
|
|||
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}
|
||||
text: %r{https://widgets\.cryptocompare\.com/serve/v3/coin/header\?fsyms=BTC,ETH&tsyms=EUR}
|
||||
end
|
||||
|
||||
def test_show_with_date_macro
|
||||
|
@ -366,6 +366,16 @@ class WikiControllerTest < Additionals::ControllerTest
|
|||
assert_select 'div.flash.error', html: /Error executing/
|
||||
end
|
||||
|
||||
def test_show_with_asciinema_macro
|
||||
@request.session[:user_id] = WIKI_MACRO_USER_ID
|
||||
@page.content.text = '{{asciinema(113463)}}'
|
||||
@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
|
||||
|
||||
def test_show_issue
|
||||
@request.session[:user_id] = WIKI_MACRO_USER_ID
|
||||
@page.content.text = '{{issue(2, format=short)}}'
|
||||
|
@ -468,44 +478,4 @@ class WikiControllerTest < Additionals::ControllerTest
|
|||
assert_select 'a[href=?]', '/users/2',
|
||||
text: 'John Smith'
|
||||
end
|
||||
|
||||
def test_show_wiki_with_header
|
||||
with_additionals_settings(global_wiki_header: 'Lore impsuum') do
|
||||
get :show,
|
||||
params: { project_id: 1, id: 'Another_page' }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div#wiki_extentions_header', text: /Lore impsuum/
|
||||
end
|
||||
end
|
||||
|
||||
def test_show_wiki_without_header
|
||||
with_additionals_settings(global_wiki_header: '') do
|
||||
get :show,
|
||||
params: { project_id: 1, id: 'Another_page' }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div#wiki_extentions_header', count: 0
|
||||
end
|
||||
end
|
||||
|
||||
def test_show_wiki_with_footer
|
||||
with_additionals_settings(global_wiki_footer: 'Lore impsuum') do
|
||||
get :show,
|
||||
params: { project_id: 1, id: 'Another_page' }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div#wiki_extentions_footer', text: /Lore impsuum/
|
||||
end
|
||||
end
|
||||
|
||||
def test_show_wiki_without_footer
|
||||
with_additionals_settings(global_wiki_footer: '') do
|
||||
get :show,
|
||||
params: { project_id: 1, id: 'Another_page' }
|
||||
|
||||
assert_response :success
|
||||
assert_select 'div#wiki_extentions_footer', count: 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue