fix datepicker and test it

This commit is contained in:
Tanguy PATTE 2015-08-24 11:42:06 +02:00
parent a9b001e762
commit 327412fba3
5 changed files with 32 additions and 3 deletions

View file

@ -25,7 +25,7 @@ Rails.application.configure do
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = false
config.assets.debug = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.

View file

@ -0,0 +1,19 @@
require 'spec_helper'
feature 'On the description page' do
let!(:dossier) { create(:dossier, :with_entreprise, :with_pieces_jointes) }
before do
visit dossier_description_path dossier
end
scenario 'date_previsionnelle field is present' do
expect(page).to have_css('#date_previsionnelle')
end
context 'when user clic on date_previsionnelle field', js: true do
before do
find_by_id('date_previsionnelle').click
end
scenario 'the datepicker popup is displayed' do
expect(page).to have_css('.datepicker-days')
end
end
end

View file

@ -31,7 +31,7 @@ RSpec.configure do |config|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
config.use_transactional_fixtures = false
# RSpec Rails can automatically mix in different behaviours to your tests
# based on their file location, for example enabling you to call `get` and

View file

@ -51,6 +51,8 @@ SIADETOKEN = :valid_token unless defined? SIADETOKEN
include Warden::Test::Helpers
WebMock.disable_net_connect!(allow_localhost: true)
RSpec.configure do |config|
config.filter_run_excluding disable: true
config.color = true

View file

@ -1,12 +1,20 @@
RSpec.configure do |config|
expect_list = %w(evenement_vies formulaires types_piece_jointe)
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation, except: %w(evenement_vies formulaires types_piece_jointe))
DatabaseCleaner.clean_with(:truncation, except: expect_list)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation, { except: expect_list }
end
config.before(:each) do
DatabaseCleaner.start
end