Sha256: e377f4f744673c5df2eeec7a7ecc71dc024322baac035aeeeb23e5c18acab0c5

Contents?: true

Size: 1.76 KB

Versions: 4

Compression:

Stored size: 1.76 KB

Contents

# coding: utf-8
require 'acceptance_helper'

feature 'プラグイン選択設定の利用' do
	plugin_path = "#{TDiary.root}/misc/plugin/rspec.rb"

	scenario '新入荷のプラグインが表示される' do
		FileUtils.rm plugin_path if File.exist? plugin_path

		visit '/update.rb?conf=sp'
		page.all('div.saveconf').first.click_button 'OK'
		expect(page).not_to have_content '新入荷'

		FileUtils.touch plugin_path

		click_link 'プラグイン選択'

		expect(page).to have_content '新入荷'
		expect(page).to have_content 'rspec.rb'

		FileUtils.rm plugin_path
	end

	scenario 'プラグイン設定を保存する' do
		FileUtils.touch plugin_path

		visit '/update.rb?conf=sp'

		check "sp.rspec.rb"
		page.all('div.saveconf').first.click_button 'OK'

		expect(page).to have_checked_field "sp.rspec.rb"

		FileUtils.rm plugin_path
	end

	scenario 'プラグインが消えたら表示されない' do
		FileUtils.touch plugin_path

		visit '/update.rb?conf=sp'
		expect(page).to have_content 'rspec.rb'

		FileUtils.rm plugin_path

		click_link 'プラグイン選択'
		expect(page).not_to have_content 'rspec.rb'
	end

	scenario '外部の Javascript を追加するプラグインを有効にする' do
		visit '/update.rb?conf=sp'

		check "sp.category_autocomplete.rb"
		page.all('div.saveconf').first.click_button 'OK'

		visit '/update.rb'

		expect(page.body).to be_include('caretposition.js')
		expect(page.body).to be_include('category_autocomplete.js')
		expect(page.body).to be_include('//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js')
		expect(page.body).not_to be_include('//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js?')
	end
end
# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:
# vim: ts=3

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/tdiary-4.2.0/spec/acceptance/save_conf_plugin_spec.rb
tdiary-4.2.0 spec/acceptance/save_conf_plugin_spec.rb
tdiary-4.1.3 spec/acceptance/save_conf_plugin_spec.rb
tdiary-4.1.2 spec/acceptance/save_conf_plugin_spec.rb