From fdc02b6d14e0d8735df71306f192db37898f7201 Mon Sep 17 00:00:00 2001 From: Christopher Alcock Date: Wed, 30 Sep 2015 12:28:28 +0100 Subject: [PATCH 01/12] displaying all charts for event on vote page as intermediary --- app/assets/javascripts/vote.js | 14 ++++++++++++++ app/controllers/events_controller.rb | 4 +++- app/views/events/vote.html.erb | 26 +++++++++++++++++++++++++- app/views/layouts/application.html.erb | 3 ++- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index fb29051..d42b166 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -1,8 +1,14 @@ $(document).ready(function() { + var currentChoice = 0; + console.log(currentChoice); + + + $('#choice-submit').click(function() { event.preventDefault(); var choiceValue = $( "input:radio[name=choice]:checked" ).val(); + currentChoice = choiceValue; $.post('/votes',{ choice: choiceValue }); $('.question').hide(); $('.holding-message').show(); @@ -37,6 +43,10 @@ $(document).ready(function() { }); +function showCurrentChoice(){ + console.log(currentChoice); +}; + function buildQuestion(data) { $('.question').show(); @@ -44,6 +54,7 @@ function buildQuestion(data) { $('#testing').text(data.test); $('#question-number').text(data.question.question_number); $('#question-title').text(data.question.content); + $('#question-id').text(data.question.id); var $choiceOptions = $('#dvOptions'); $choiceOptions.empty(); for ( var i = 0; i < data.choices.length; i++) { @@ -51,4 +62,7 @@ function buildQuestion(data) { + data.choices[i].id + '">')); }; + $( ".question-form").submit(function(){ + console.log("hiya") + }); }; diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 5af5b8f..8eb1187 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -55,6 +55,8 @@ def update def vote @event = Event.find(params[:id]) + p params + # @choice = Choice.find(params[:choice_id]) end def parse_event_id @@ -83,6 +85,6 @@ def generate_code(event_id) private def event_params - params.require(:event).permit(:title, :description) + params.require(:event).permit(:title, :description, :choices_attributes[:content, :id]) end end diff --git a/app/views/events/vote.html.erb b/app/views/events/vote.html.erb index b5281a2..b9bc60e 100644 --- a/app/views/events/vote.html.erb +++ b/app/views/events/vote.html.erb @@ -8,6 +8,7 @@

Awaiting Question

<%= @event.description %>

+
@@ -15,10 +16,33 @@

Question ? of <%= @event.questions.count %>:

+

- +
+ + +<% @event.questions.each do |question|%> + +<% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 06339be..3a1d0aa 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,6 +14,7 @@ <%= render partial: "shared/flash_messages", flash: flash %> <%= yield %> + <%= debug(params) if Rails.env.development? %> - \ No newline at end of file + From 0345f227163aa964e759d762bb70a90b856b667c Mon Sep 17 00:00:00 2001 From: Christopher Alcock Date: Wed, 30 Sep 2015 13:55:36 +0100 Subject: [PATCH 02/12] small change --- app/assets/javascripts/vote.js | 2 ++ app/views/events/vote.html.erb | 1 + 2 files changed, 3 insertions(+) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index fb29051..2b4a9c4 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -44,6 +44,8 @@ function buildQuestion(data) { $('#testing').text(data.test); $('#question-number').text(data.question.question_number); $('#question-title').text(data.question.content); + $('#question-title-hold').text(data.question.content); + var $choiceOptions = $('#dvOptions'); $choiceOptions.empty(); for ( var i = 0; i < data.choices.length; i++) { diff --git a/app/views/events/vote.html.erb b/app/views/events/vote.html.erb index b5281a2..5d0a6cb 100644 --- a/app/views/events/vote.html.erb +++ b/app/views/events/vote.html.erb @@ -1,4 +1,5 @@

<%= @event.title %>

+

From bbba5922dd903614b5f2327669610a128cf09dc7 Mon Sep 17 00:00:00 2001 From: Christopher Alcock Date: Wed, 30 Sep 2015 14:27:59 +0100 Subject: [PATCH 03/12] IDs assigned --- app/assets/javascripts/vote.js | 2 +- app/views/events/vote.html.erb | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index 2b4a9c4..71874c6 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -44,7 +44,7 @@ function buildQuestion(data) { $('#testing').text(data.test); $('#question-number').text(data.question.question_number); $('#question-title').text(data.question.content); - $('#question-title-hold').text(data.question.content); + $('#question-id-hold').text(data.question.id); var $choiceOptions = $('#dvOptions'); $choiceOptions.empty(); diff --git a/app/views/events/vote.html.erb b/app/views/events/vote.html.erb index 5d0a6cb..6c0c837 100644 --- a/app/views/events/vote.html.erb +++ b/app/views/events/vote.html.erb @@ -1,5 +1,5 @@

<%= @event.title %>

-

+

@@ -23,3 +23,23 @@ + +<% @event.questions.each do |question| %> + <% if question.choices.any? %> +
+ <% question.choices.each do |choice| %> + <%= div_for choice, 'data-votecount' => choice.votes.count || 0 do %> + + <%= choice.content %> +

+ Votes: <%= choice.votes.count || 0 %> +

+
+
+
+
+ <% end %> + <% end %> +
+ <% end %> +<% end %> From 21d703f6c369018582c69c43c6cb8f441b77e4e2 Mon Sep 17 00:00:00 2001 From: Christopher Alcock Date: Wed, 30 Sep 2015 15:57:24 +0100 Subject: [PATCH 04/12] working, but graph showing too early --- app/assets/javascripts/vote.js | 8 +++++++- app/views/events/vote.html.erb | 37 +++++++++++++++++----------------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index 71874c6..c0b46fc 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -27,7 +27,13 @@ $(document).ready(function() { channel = pusher.subscribe('test_channel'); return channel.bind(myEvent(), function(data) { console.log('message received'); - buildQuestion(data); + buildQuestion(data) + for (var i = 0; i < 1000; i++) { + if (+($('#question-id-hold').text()) === i) { + $(".graphs#" + ($('#question-id-hold').text())).show() + }; + }; + }); function myEvent(){ diff --git a/app/views/events/vote.html.erb b/app/views/events/vote.html.erb index 6c0c837..41208d1 100644 --- a/app/views/events/vote.html.erb +++ b/app/views/events/vote.html.erb @@ -1,5 +1,5 @@

<%= @event.title %>

-

+

@@ -24,22 +24,23 @@ -<% @event.questions.each do |question| %> - <% if question.choices.any? %> -
- <% question.choices.each do |choice| %> - <%= div_for choice, 'data-votecount' => choice.votes.count || 0 do %> - - <%= choice.content %> -

- Votes: <%= choice.votes.count || 0 %> -

-
-
+
+ <% @event.questions.each do |question| %> + <% if question.choices.any? %> + - <% end %> - <% end %> -
+ <% end %> + <% end %> +
+ <% end %> <% end %> -<% end %> +
From 1370b54d41fc150cfb32dced0f949b7623435613 Mon Sep 17 00:00:00 2001 From: Christopher Alcock Date: Wed, 30 Sep 2015 16:34:47 +0100 Subject: [PATCH 05/12] actually working --- app/assets/javascripts/vote.js | 16 +++++++++------- app/views/events/vote.html.erb | 11 +++++++---- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index c0b46fc..0306852 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -1,11 +1,17 @@ $(document).ready(function() { + $('#event-progress').hide(); + $('#choice-submit').click(function() { event.preventDefault(); var choiceValue = $( "input:radio[name=choice]:checked" ).val(); $.post('/votes',{ choice: choiceValue }); $('.question').hide(); - $('.holding-message').show(); + for (var i = 0; i < 1000; i++) { + if (+($('#question-id-hold').text()) === i) { + $(".graphs#" + ($('#question-id-hold').text())).show() + }; + }; }); var channel, pusher; @@ -28,12 +34,8 @@ $(document).ready(function() { return channel.bind(myEvent(), function(data) { console.log('message received'); buildQuestion(data) - for (var i = 0; i < 1000; i++) { - if (+($('#question-id-hold').text()) === i) { - $(".graphs#" + ($('#question-id-hold').text())).show() - }; - }; - + $('#event-progress').show(); + $('.graphs').hide(); }); function myEvent(){ diff --git a/app/views/events/vote.html.erb b/app/views/events/vote.html.erb index 41208d1..6b5c863 100644 --- a/app/views/events/vote.html.erb +++ b/app/views/events/vote.html.erb @@ -11,10 +11,13 @@

<%= @event.description %>

+ +

+
-

Question ? of <%= @event.questions.count %>:

-

    @@ -24,7 +27,7 @@
-
+ <% @event.questions.each do |question| %> <% if question.choices.any? %> <% end %> <% end %> -
+ From 648471be6dc2c41b743587af88491cb5221d5a2f Mon Sep 17 00:00:00 2001 From: Christopher Alcock Date: Wed, 30 Sep 2015 17:55:16 +0100 Subject: [PATCH 06/12] js test failing --- app/assets/javascripts/vote.js | 11 ++++++++--- app/controllers/events_controller.rb | 4 +--- app/views/events/vote.html.erb | 1 + app/views/layouts/application.html.erb | 1 - spec/features/voting_feature_spec.rb | 3 ++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index be4e5c0..c425c19 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -39,9 +39,8 @@ $(document).ready(function() { channel = pusher.subscribe('test_channel'); return channel.bind(myEvent(), function(data) { console.log('message received'); - buildQuestion(data) - $('#event-progress').show(); - $('.graphs').hide(); + buildQuestion(data); + showProgress(); }); function myEvent(){ @@ -51,6 +50,11 @@ $(document).ready(function() { }); +function showProgress(){ + $('#event-progress').show(); + $('.graphs').hide(); +}; + function showCurrentChoice(){ console.log(currentChoice); }; @@ -74,4 +78,5 @@ function buildQuestion(data) { $( ".question-form").submit(function(){ console.log("hiya") }); + showProgress(); }; diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 8eb1187..5af5b8f 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -55,8 +55,6 @@ def update def vote @event = Event.find(params[:id]) - p params - # @choice = Choice.find(params[:choice_id]) end def parse_event_id @@ -85,6 +83,6 @@ def generate_code(event_id) private def event_params - params.require(:event).permit(:title, :description, :choices_attributes[:content, :id]) + params.require(:event).permit(:title, :description) end end diff --git a/app/views/events/vote.html.erb b/app/views/events/vote.html.erb index fb1fae3..15db858 100644 --- a/app/views/events/vote.html.erb +++ b/app/views/events/vote.html.erb @@ -32,6 +32,7 @@ <% @event.questions.each do |question| %> <% if question.choices.any? %> diff --git a/spec/features/voting_feature_spec.rb b/spec/features/voting_feature_spec.rb index e85a1c1..acbe9ef 100644 --- a/spec/features/voting_feature_spec.rb +++ b/spec/features/voting_feature_spec.rb @@ -32,7 +32,8 @@ expect(page).to have_content 'Maybe' click_button "Submit Answer" page.execute_script("$(document).ready(function() { buildQuestion(#{data_creator("2")}) });") - expect(page).to have_content 'Question 2 of 2' + page.execute_script("$('#choice-submit').click(function()") + expect(page).to have_content 'Results' end end end From 3346d8912c69d74d9193a00922c1b6904466f717 Mon Sep 17 00:00:00 2001 From: Christopher Alcock Date: Wed, 30 Sep 2015 18:14:02 +0100 Subject: [PATCH 07/12] tests still failing --- app/assets/javascripts/vote.js | 1 - spec/features/voting_feature_spec.rb | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index c425c19..d0a0cba 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -40,7 +40,6 @@ $(document).ready(function() { return channel.bind(myEvent(), function(data) { console.log('message received'); buildQuestion(data); - showProgress(); }); function myEvent(){ diff --git a/spec/features/voting_feature_spec.rb b/spec/features/voting_feature_spec.rb index acbe9ef..7c3e5fa 100644 --- a/spec/features/voting_feature_spec.rb +++ b/spec/features/voting_feature_spec.rb @@ -31,9 +31,8 @@ expect(page).to have_content 'No' expect(page).to have_content 'Maybe' click_button "Submit Answer" - page.execute_script("$(document).ready(function() { buildQuestion(#{data_creator("2")}) });") - page.execute_script("$('#choice-submit').click(function()") - expect(page).to have_content 'Results' + # page.execute_script("$(document).ready(function() { buildQuestion(#{data_creator("2")}) });") + expect(page).to have_content 'Results:' end end end From b76474780672d1148d310ad93f114d3b9824a56c Mon Sep 17 00:00:00 2001 From: lewis Date: Wed, 30 Sep 2015 19:06:49 +0100 Subject: [PATCH 08/12] working in localhost --- app/assets/javascripts/vote.js | 7 ++++--- spec/features/voting_feature_spec.rb | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index a2e7807..6855b71 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -1,4 +1,5 @@ var ready = function() { + $('#event-progress').hide(); $('#choice-submit').click(function() { @@ -13,6 +14,7 @@ var ready = function() { }; }; }); + var channel, pusher; Pusher.log = function(message) { if (window.console && window.console.log) { @@ -39,9 +41,6 @@ var ready = function() { return "event_" + event_number }; - - - function showCurrentChoice(){ console.log(currentChoice); }; @@ -51,6 +50,8 @@ var ready = function() { $(document).ready(ready); $(document).on('page:load', ready); + + function showProgress(){ $('#event-progress').show(); $('.graphs').hide(); diff --git a/spec/features/voting_feature_spec.rb b/spec/features/voting_feature_spec.rb index 7c3e5fa..c4a4a88 100644 --- a/spec/features/voting_feature_spec.rb +++ b/spec/features/voting_feature_spec.rb @@ -12,8 +12,12 @@ @choice = create :choice, question: @question @choice2 = create :choice_2, question: @question @choice3 = create :choice_3, question: @question + @choice.votes.create end + + + it "can navigate to voting page and it says 'Awaiting Question' and gives the event description" do visit vote_event_path(@event) expect(page).to have_content 'Event 1' @@ -30,6 +34,7 @@ expect(page).to have_content 'Yes' expect(page).to have_content 'No' expect(page).to have_content 'Maybe' + @choice.votes.create click_button "Submit Answer" # page.execute_script("$(document).ready(function() { buildQuestion(#{data_creator("2")}) });") expect(page).to have_content 'Results:' From 982dbd3a64f38065011fb16d226a4ad702810722 Mon Sep 17 00:00:00 2001 From: lewis Date: Wed, 30 Sep 2015 19:24:09 +0100 Subject: [PATCH 09/12] refactored 1000 setting suns --- app/assets/javascripts/vote.js | 57 +++++++++++++--------------- spec/features/voting_feature_spec.rb | 1 - 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index 6855b71..634f68e 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -8,11 +8,7 @@ var ready = function() { currentChoice = choiceValue; $.post('/votes',{ choice: choiceValue }); $('.question').hide(); - for (var i = 0; i < 1000; i++) { - if (+($('#question-id-hold').text()) === i) { - $(".graphs#" + ($('#question-id-hold').text())).show() - }; - }; + $(".graphs#" + ($('#question-id-hold').text())).show(); }); var channel, pusher; @@ -48,32 +44,31 @@ var ready = function() { -$(document).ready(ready); -$(document).on('page:load', ready); - +function showProgress(){ + $('#event-progress').show(); + $('.graphs').hide(); +}; - function showProgress(){ - $('#event-progress').show(); - $('.graphs').hide(); - }; +function buildQuestion(data) { + $('.question').show(); + $('.holding-message').hide(); + $('#testing').text(data.test); + $('#question-number').text(data.question.question_number); + $('#question-title').text(data.question.content); + $('#question-id-hold').text(data.question.id); - function buildQuestion(data) { - $('.question').show(); - $('.holding-message').hide(); - $('#testing').text(data.test); - $('#question-number').text(data.question.question_number); - $('#question-title').text(data.question.content); - $('#question-id-hold').text(data.question.id); + var $choiceOptions = $('#dvOptions'); + $choiceOptions.empty(); + for ( var i = 0; i < data.choices.length; i++) { + $choiceOptions.append($('
  • ')); + }; + $( ".question-form").submit(function(){ + console.log("hiya") + }); + showProgress(); +}; - var $choiceOptions = $('#dvOptions'); - $choiceOptions.empty(); - for ( var i = 0; i < data.choices.length; i++) { - $choiceOptions.append($('
  • ')); - }; - $( ".question-form").submit(function(){ - console.log("hiya") - }); - showProgress(); - }; +$(document).ready(ready); +$(document).on('page:load', ready); diff --git a/spec/features/voting_feature_spec.rb b/spec/features/voting_feature_spec.rb index c4a4a88..650b0d2 100644 --- a/spec/features/voting_feature_spec.rb +++ b/spec/features/voting_feature_spec.rb @@ -34,7 +34,6 @@ expect(page).to have_content 'Yes' expect(page).to have_content 'No' expect(page).to have_content 'Maybe' - @choice.votes.create click_button "Submit Answer" # page.execute_script("$(document).ready(function() { buildQuestion(#{data_creator("2")}) });") expect(page).to have_content 'Results:' From 4bc7b700f194121a93afd4055740aa625ec0240a Mon Sep 17 00:00:00 2001 From: lewis Date: Wed, 30 Sep 2015 19:42:50 +0100 Subject: [PATCH 10/12] before pull request --- app/assets/javascripts/vote.js | 17 +++++++++++------ spec/controllers/questions_controller_spec.rb | 2 +- spec/features/voting_feature_spec.rb | 9 +++------ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js index 634f68e..80e0bda 100644 --- a/app/assets/javascripts/vote.js +++ b/app/assets/javascripts/vote.js @@ -5,10 +5,10 @@ var ready = function() { $('#choice-submit').click(function() { event.preventDefault(); var choiceValue = $( "input:radio[name=choice]:checked" ).val(); - currentChoice = choiceValue; - $.post('/votes',{ choice: choiceValue }); - $('.question').hide(); - $(".graphs#" + ($('#question-id-hold').text())).show(); + answerSubmit(choiceValue); + // $.post('/votes',{ choice: choiceValue }); + // $('.question').hide(); + // $(".graphs#" + ($('#question-id-hold').text())).show(); }); var channel, pusher; @@ -21,12 +21,13 @@ var ready = function() { function pusherKey(){ var event_number = $('#pusher-key').text(); - return event_number + return event_number; }; pusher = new Pusher(pusherKey(), { encrypted: true }); + channel = pusher.subscribe('test_channel'); return channel.bind(myEvent(), function(data) { buildQuestion(data); @@ -42,7 +43,11 @@ var ready = function() { }; }; - +function answerSubmit(choiceValue){ + $.post('/votes',{ choice: choiceValue }); + $('.question').hide(); + $(".graphs#" + ($('#question-id-hold').text())).show(); +}; function showProgress(){ $('#event-progress').show(); diff --git a/spec/controllers/questions_controller_spec.rb b/spec/controllers/questions_controller_spec.rb index a84b275..8742b03 100644 --- a/spec/controllers/questions_controller_spec.rb +++ b/spec/controllers/questions_controller_spec.rb @@ -29,7 +29,7 @@ "question"=>{"id"=>question.id, "content"=>question.content, "question_number"=>1}, - "choices"=>[{"content"=>choice.content, "id"=>choice.id}, {"content"=>choice2.content, "id"=>choice2.id}]} ) + "choices"=>[{"content"=>choice2.content, "id"=>choice2.id}, {"content"=>choice.content, "id"=>choice.id}]} ) end end diff --git a/spec/features/voting_feature_spec.rb b/spec/features/voting_feature_spec.rb index 650b0d2..f3461b4 100644 --- a/spec/features/voting_feature_spec.rb +++ b/spec/features/voting_feature_spec.rb @@ -12,12 +12,9 @@ @choice = create :choice, question: @question @choice2 = create :choice_2, question: @question @choice3 = create :choice_3, question: @question - @choice.votes.create + # @choice.votes.create end - - - it "can navigate to voting page and it says 'Awaiting Question' and gives the event description" do visit vote_event_path(@event) expect(page).to have_content 'Event 1' @@ -34,9 +31,9 @@ expect(page).to have_content 'Yes' expect(page).to have_content 'No' expect(page).to have_content 'Maybe' - click_button "Submit Answer" - # page.execute_script("$(document).ready(function() { buildQuestion(#{data_creator("2")}) });") + page.execute_script("$(document).ready(function() { answerSubmit(#{@choice.id}) });") expect(page).to have_content 'Results:' + expect(page).to have_css("#choice_#{@choice.id} .progress .progress-bar") end end end From 596eb0b7af209fc5baeab9f676fca1a658c50b39 Mon Sep 17 00:00:00 2001 From: lewis Date: Wed, 30 Sep 2015 19:59:11 +0100 Subject: [PATCH 11/12] may have fixed --- spec/controllers/questions_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/questions_controller_spec.rb b/spec/controllers/questions_controller_spec.rb index 8742b03..a84b275 100644 --- a/spec/controllers/questions_controller_spec.rb +++ b/spec/controllers/questions_controller_spec.rb @@ -29,7 +29,7 @@ "question"=>{"id"=>question.id, "content"=>question.content, "question_number"=>1}, - "choices"=>[{"content"=>choice2.content, "id"=>choice2.id}, {"content"=>choice.content, "id"=>choice.id}]} ) + "choices"=>[{"content"=>choice.content, "id"=>choice.id}, {"content"=>choice2.content, "id"=>choice2.id}]} ) end end From 321bbdfba298dea4ce6f1eb2db18fd69249a7201 Mon Sep 17 00:00:00 2001 From: lewis Date: Wed, 30 Sep 2015 20:21:52 +0100 Subject: [PATCH 12/12] tests passing locally --- spec/features/questions_feature_spec.rb | 2 +- spec/features/voting_feature_spec.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/features/questions_feature_spec.rb b/spec/features/questions_feature_spec.rb index 8271969..724cf56 100644 --- a/spec/features/questions_feature_spec.rb +++ b/spec/features/questions_feature_spec.rb @@ -164,7 +164,7 @@ page.execute_script("$(document).ready(function() { choiceVotebuilder(#{vote_creator(@choice1.id, "2")}) });") expect(page).to have_css("#choice_#{@choice1.id}[data-votecount='2']") page.execute_script("$(document).ready(function() { choiceVotebuilder(#{vote_creator(@choice1.id, "3")}) });") - expect(page).to have_css("#choice_#{@choice1.id}[data-votecount='3']") + expect(page).to have_css("#choice_#{@choice1.id}[data-votecount='3']") end end end diff --git a/spec/features/voting_feature_spec.rb b/spec/features/voting_feature_spec.rb index f3461b4..500e8c9 100644 --- a/spec/features/voting_feature_spec.rb +++ b/spec/features/voting_feature_spec.rb @@ -12,7 +12,6 @@ @choice = create :choice, question: @question @choice2 = create :choice_2, question: @question @choice3 = create :choice_3, question: @question - # @choice.votes.create end it "can navigate to voting page and it says 'Awaiting Question' and gives the event description" do