Sha256: 13c85ee9929387926529313031fb6445391e7839f961e66003719e8f7047beda

Contents?: true

Size: 1.23 KB

Versions: 12

Compression:

Stored size: 1.23 KB

Contents

# -*- coding: utf-8 -*-

module HelperMethods
	def append_default_diary(ymd = Date.today.to_s)
		date = Date.parse(ymd)
		visit '/update.rb'
		fill_in "year", with: date.year
		fill_in "month", with: date.month
		fill_in "day", with: date.day
		fill_in "title", with: "tDiaryのテスト"
		fill_in "body", with: <<-BODY
!さて、テストである。
とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P
BODY
		click_button "追記"
	end

	def append_default_comment(ymd = Date.today.to_s)
		visit "/"
		date = Date.parse(ymd).strftime('%Y年%m月%d日')
		page.find('h2', text: date).click_link date
		click_link 'ツッコミを入れる'
		fill_in "name", with: "alpha"
		fill_in "body", with: 'こんにちは!こんにちは!'
		click_button '投稿'
	end

	def enable_plugin(name)
		visit '/update.rb?conf=sp'
		check "sp.#{name}.rb"
		page.all('div.saveconf').first.click_button 'OK'
	end

	def disable_plugin(name)
		visit '/update.rb?conf=sp'
		uncheck "sp.#{name}.rb"
		page.all('div.saveconf').first.click_button 'OK'
	end
end

RSpec.configuration.include(HelperMethods)

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:
# vim: ts=3

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/tdiary-4.2.0/spec/acceptance/support/helpers.rb
tdiary-4.2.0 spec/acceptance/support/helpers.rb
tdiary-4.1.3 spec/acceptance/support/helpers.rb
tdiary-4.1.2 spec/acceptance/support/helpers.rb
tdiary-4.1.1 spec/acceptance/support/helpers.rb
tdiary-4.1.0 spec/acceptance/support/helpers.rb
tdiary-4.1.0.20141126 spec/acceptance/support/helpers.rb
tdiary-4.0.5.1 spec/acceptance/support/helpers.rb
tdiary-4.0.5 spec/acceptance/support/helpers.rb
tdiary-4.0.4 spec/acceptance/support/helpers.rb
tdiary-4.0.3 spec/acceptance/support/helpers.rb
tdiary-4.0.2.20140201 spec/acceptance/support/helpers.rb