fix datepicker and test it
This commit is contained in:
parent
a9b001e762
commit
327412fba3
5 changed files with 32 additions and 3 deletions
|
@ -25,7 +25,7 @@ Rails.application.configure do
|
||||||
# Debug mode disables concatenation and preprocessing of assets.
|
# Debug mode disables concatenation and preprocessing of assets.
|
||||||
# This option may cause significant delays in view rendering with a large
|
# This option may cause significant delays in view rendering with a large
|
||||||
# number of complex assets.
|
# 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,
|
# 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.
|
# yet still be able to expire them through the digest params.
|
||||||
|
|
19
spec/features/datepicker_spec.rb
Normal file
19
spec/features/datepicker_spec.rb
Normal 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
|
|
@ -31,7 +31,7 @@ RSpec.configure do |config|
|
||||||
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
# 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
|
# examples within a transaction, remove the following line or assign false
|
||||||
# instead of true.
|
# instead of true.
|
||||||
config.use_transactional_fixtures = true
|
config.use_transactional_fixtures = false
|
||||||
|
|
||||||
# RSpec Rails can automatically mix in different behaviours to your tests
|
# RSpec Rails can automatically mix in different behaviours to your tests
|
||||||
# based on their file location, for example enabling you to call `get` and
|
# based on their file location, for example enabling you to call `get` and
|
||||||
|
|
|
@ -51,6 +51,8 @@ SIADETOKEN = :valid_token unless defined? SIADETOKEN
|
||||||
|
|
||||||
include Warden::Test::Helpers
|
include Warden::Test::Helpers
|
||||||
|
|
||||||
|
WebMock.disable_net_connect!(allow_localhost: true)
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
config.filter_run_excluding disable: true
|
config.filter_run_excluding disable: true
|
||||||
config.color = true
|
config.color = true
|
||||||
|
|
|
@ -1,12 +1,20 @@
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
|
|
||||||
|
expect_list = %w(evenement_vies formulaires types_piece_jointe)
|
||||||
|
|
||||||
config.before(:suite) do
|
config.before(:suite) do
|
||||||
DatabaseCleaner.clean_with(:truncation, except: %w(evenement_vies formulaires types_piece_jointe))
|
DatabaseCleaner.clean_with(:truncation, except: expect_list)
|
||||||
end
|
end
|
||||||
|
|
||||||
config.before(:each) do
|
config.before(:each) do
|
||||||
DatabaseCleaner.strategy = :transaction
|
DatabaseCleaner.strategy = :transaction
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.before(:each, js: true) do
|
||||||
|
DatabaseCleaner.strategy = :truncation, { except: expect_list }
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
config.before(:each) do
|
config.before(:each) do
|
||||||
DatabaseCleaner.start
|
DatabaseCleaner.start
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue