Skip to content

Commit

Permalink
Fix feature spec (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsanta authored Sep 11, 2017
1 parent 948b92a commit 6752548
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions spec/feature/user_searches_resources_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,12 @@
scenario 'users can filter by date' do
title = Faker::Hipster.sentence

create(:resource, title: "#{title} My Resource", resource_type: :article)
create(
:resource,
title: "#{title} My Resource",
resource_type: :article,
created_at: 3.days.from_now
)

wait_for do
Elasticsearch::Model.search(title, [Resource]).results.total
Expand All @@ -221,9 +226,10 @@
expect(page).to have_text('My Resource')
expect(page).to have_css('a.btn-add-to-list')

find('input[name=daterange]').click
all('.available')[3].click
all('.available')[6].click
daterange = find('input[name=daterange]')
daterange.set('date-start' => 5.months.ago.to_i)
daterange.set('date-end' => 3.months.ago.to_i)
daterange.click
find('.applyBtn').click
wait_for_ajax

Expand Down

0 comments on commit 6752548

Please sign in to comment.