-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathedit_form_spec.rb
More file actions
29 lines (24 loc) · 824 Bytes
/
edit_form_spec.rb
File metadata and controls
29 lines (24 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'spec_helper'
describe 'authors index', type: :feature, js: true do
before do
add_author_resource
end
context 'edit form' do
before do
visit '/admin/authors/new'
end
before do
page.find('#author_birthday').click
sleep 0.3
picker = page.find('.xdsoft_datetimepicker', visible: true)
picker.find('.xdsoft_calendar td.xdsoft_date[data-date="1"]', match: :first).click
sleep 0.2
picker.find('.xdsoft_timepicker.active .xdsoft_time.xdsoft_current').click
end
it 'can set birthday' do
date_birthday = Date.today.beginning_of_month.strftime("%Y-%m-%d")
expect(page.find('#author_birthday').value).to start_with(date_birthday)
expect(page).to have_css('#author_birthday[placeholder="Formtastic placeholder"]')
end
end
end