Skip to content

Commit

Permalink
Disable checkins page poller in test to fix flaky spec
Browse files Browse the repository at this point in the history
The poller was triggering an extra request to checkins' index.json,
which would often arrive while the test data was being torn down,
and would therefore raise an exception about the test event
not existing.

Also: bundle update
  • Loading branch information
tjgrathwell committed Aug 17, 2013
1 parent e504ca6 commit d28b310
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
30 changes: 15 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ GEM
crack (0.4.1)
safe_yaml (~> 0.9.0)
daemons (1.1.9)
devise (2.2.5)
devise (2.2.6)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (~> 3.1)
Expand Down Expand Up @@ -101,7 +101,7 @@ GEM
faye-websocket (0.4.7)
eventmachine (>= 0.12.0)
ffi (1.9.0)
font-awesome-rails (3.2.1.2)
font-awesome-rails (3.2.1.3)
railties (>= 3.2, < 5.0)
formatador (0.2.4)
fssm (0.2.10)
Expand All @@ -124,7 +124,7 @@ GEM
hike (1.2.3)
http_parser.rb (0.5.3)
httpauth (0.2.0)
i18n (0.6.4)
i18n (0.6.5)
jasmine (1.3.2)
jasmine-core (~> 1.3.1)
rack (~> 1.0)
Expand All @@ -145,7 +145,7 @@ GEM
multi_json (>= 1.5)
launchy (2.3.0)
addressable (~> 2.3)
listen (1.2.2)
listen (1.3.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
Expand All @@ -154,9 +154,9 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.8.2)
mime-types (1.23)
mime-types (1.24)
mini_portile (0.5.1)
multi_json (1.7.8)
multi_json (1.7.9)
multipart-post (1.2.0)
nested_form (0.3.2)
nokogiri (1.6.0)
Expand Down Expand Up @@ -213,7 +213,7 @@ GEM
thor (>= 0.14.6, < 2.0)
rake (10.1.0)
rb-fsevent (0.9.3)
rb-inotify (0.9.0)
rb-inotify (0.9.1)
ffi (>= 0.5.0)
rb-kqueue (0.2.0)
ffi (>= 0.5.0)
Expand All @@ -223,10 +223,10 @@ GEM
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.4)
rspec-expectations (2.14.0)
rspec-core (2.14.5)
rspec-expectations (2.14.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.2)
rspec-mocks (2.14.3)
rspec-rails (2.14.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
Expand All @@ -235,7 +235,7 @@ GEM
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rubyzip (0.9.9)
safe_yaml (0.9.4)
safe_yaml (0.9.5)
sanitize (2.0.6)
nokogiri (>= 1.4.4)
sass (3.2.10)
Expand All @@ -245,10 +245,10 @@ GEM
tilt (~> 1.3)
sass_rails_patch (0.0.2)
sass-rails
select2-rails (3.4.6)
select2-rails (3.4.8)
sass-rails
thor (~> 0.14)
selenium-webdriver (2.33.0)
selenium-webdriver (2.35.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip
Expand All @@ -259,7 +259,7 @@ GEM
uuidtools
sextant (0.2.4)
rails (>= 3.2)
shoulda-matchers (2.2.0)
shoulda-matchers (2.3.0)
activesupport (>= 3.0.0)
simple_form (2.1.0)
actionpack (~> 3.0)
Expand All @@ -281,7 +281,7 @@ GEM
treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
turbo-sprockets-rails3 (0.3.6)
turbo-sprockets-rails3 (0.3.8)
railties (> 3.2.8, < 4.0.0)
sprockets (>= 2.0.0)
tzinfo (0.3.37)
Expand Down
5 changes: 3 additions & 2 deletions app/assets/javascripts/checkins.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Bridgetroll.Collections.RsvpSession = Backbone.Collection.extend
constructorName: 'RsvpSessionCollection'
model: Bridgetroll.Models.RsvpSession

window.setupCheckinsPage = (event_id, session_id) ->
window.setupCheckinsPage = (event_id, session_id, options) ->
rsvpSessions = new Bridgetroll.Collections.RsvpSession()

poller = new Bridgetroll.Services.Poller
Expand All @@ -34,4 +34,5 @@ window.setupCheckinsPage = (event_id, session_id) ->
row.find('.destroy').toggleClass('hidden', !sessionRsvp.get('checked_in'))
$('#checked_in_count').text(checked_in_count)

poller.startPolling()
if options.poll
poller.startPolling()
2 changes: 1 addition & 1 deletion app/views/checkins/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</table>

<script>
window.setupCheckinsPage(<%= @event.id %>, <%= @session.id %>);
window.setupCheckinsPage(<%= @event.id %>, <%= @session.id %>, {poll: <%= !Rails.env.test? %>});
</script>

<% if @event.organizer?(current_user) %>
Expand Down

0 comments on commit d28b310

Please sign in to comment.