From 8ac5abb7bc678dcaf4f6ae112e880becefaf825f Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 26 Aug 2015 19:06:12 +0200 Subject: [PATCH 01/13] Updates custom icons font --- app/assets/fonts/icons.eot | Bin 5824 -> 7048 bytes app/assets/fonts/icons.svg | 5 +++++ app/assets/fonts/icons.ttf | Bin 5668 -> 6892 bytes app/assets/fonts/icons.woff | Bin 4464 -> 5472 bytes app/assets/stylesheets/icons.scss | 16 +++++++++++++++- 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/assets/fonts/icons.eot b/app/assets/fonts/icons.eot index a1cc83d43d12151ca8a386601a45b4974e3b0142..81c974cd3258f7d6f9c571b76923521fc7617880 100644 GIT binary patch delta 1655 zcmZ8hO^g&p6s}j*)m1&+Jv~3&J-zeG&g}HSlAUE|=LfSZ%kJv(yONE@p9s+juxP>p zS-=2+%zDsZI_!jK7Zi^2pJ%%cH0M>Jh?j5#j}J z9qu0D)%QM%5>V)UMSsS3)VT{sk00#r$nIUnxHYu5uXN9xAa9dvxW5(c4ad4Ghn=Yp z?h+FGguY`Zj-NcGy`U}PJv(v#O#(P#zkl!agEyS%--t=kLC9@(6=VLLDH-^snxfBP zjFrgM=q|j*X34o|D_vSjsc6zC>oej|SV(?wJ|SypshjddBZqL7*w!zaBj*se`puHA zT0O>GRc!PfZSgG0k$m(A-9Zb*XqXkFF3YfNE+4(iE=F6Jj0|loCOX*TR+xX?NPKW~bf3 z;7+@d@jX}gYRve+c{1Qy-0}D~uv!m-FM|Ni`p%l?Py61Q<9BlTTw$C_>G!0h;{`Nx zJVA6CEac*8QF<^!gxJe4+ zCA7;z7rM%#1h{I?fI@+3wwtxE=41Xsuas*z3Y@}TE$pO`SQsvrPDW~@=ZyF7T=!DA{qdG8k6gJ>A29gP( z*_y+$)o^rD#SI0cPZ+2o1CNMDwh_|7LLkI(2%9s|&iDo7!Oidia-lnbRm9>U8DY(H zd;bf?3f?rCW@r)Tk+jTJ&f#m$q!vRkAgHiL6T`*2MY-gC&ik>L^-gQc53a?5_k|_; zF`ZlKRa~8SGAZ8-hQQLmSRGH>F}~B*oRN)x>NwO%!Nm21Ctx9WB zkv|1qWl&Dx>K=^jHfFmM6T#5d*^O~cFvWCt>EXkriDoXlgcNBy#2Ef(27-n=q(OF* zE96rp=~`344acEQYvnqqRah&Bl``UAZzvem)}_*EGo_X~sOy!MuoXe=)i6P{6vfEo zKbs{Oyu42QfZ3<=8R#i|7TT&9&5qLE6Jc==q4ow?Cq1y0ZWsp%i~)A4Geb}WWV*gg znzoQJGm&=OWZJeJ+mIDa2&0(JI*!H!H;t@QFs^PvyBc2)5?ph=3l<$_A3JWPj!&`^k+aVhP1 zIhl~A(zO)vILLG|6Hf(hI`7y?+j6XUGI7m!yrGPjOv$uvN=ujA&|;3T%(&x>jZ_)a zr4e%y>7<{m#BKZnP#UBJXs9p^XudGIv9!V9yGC}Y2S08%++U#`UH3NOc-uP(rD(x# a8LyN5oj2Kujm?Q=aeD}rRCg+^@JLlZ*-1CaPm5{6A1v58B`w8vUh5X^G=z4vE|j2)iWKgurE!HX01&dX&kZMM-Hx7 z*@e3PgL|O9iMbVfHMcIWrOi1-))Nr)v_kTwG+!6{K()aHa4Vi$|3?E(-mQZ=7a{4# zp?VNA(n4PK853NbZ+9%NG>Va4~D{denyRT}0H9zl;9FpA&xNYL1L(9YGz#nN>^To;;c*eDtP6I;UTQ Mo4Knm9sh6m3lD%^+5i9m diff --git a/app/assets/fonts/icons.svg b/app/assets/fonts/icons.svg index 049938913..da328ba6e 100644 --- a/app/assets/fonts/icons.svg +++ b/app/assets/fonts/icons.svg @@ -30,4 +30,9 @@ + + + + + diff --git a/app/assets/fonts/icons.ttf b/app/assets/fonts/icons.ttf index aa9c63faae88382db31d66dded442022c23bbae3..207ad475e797e86deb07d18b464f9ed6ea8a6519 100644 GIT binary patch delta 1663 zcmZ8hOKclO7@mJ-XJ^*C>-A%Iz45cP<8_)+hd6!|C4D4;v}qekM8!i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OzU=0V{z zph$Oy{~eS%4!<3W87ihCv`0`DxsVEy1tb+R+t{sj-fWNQ3{;5W?BEx@dnJ%8l-!sp z4Epk|%&DhLvd6}dF8VfmSeV6znd@*aM>8Ur+Q@cMmkbhN#+Mmiash{0nm)8p?0?zn zuTjnRLxtNKx+BTzf7ah`*@{k3q?T0klN?-hM@g5hi(l5*02H%F9DZmw0WRNYs=L4hsLO&Hp57!iR?f`0$wnlE? zsf9W--Zl1RFEmrv_?oo>BOp4t1#(XkGg-NHbJFeRZa>g-0yrc5)zhbYOn_EPC6?JR+!x84|#_ z{^0hVFc5L=Wfu;Vo?e{mu4~5Z@Bi+-$0-Z3JcSoHf6|QjI9Pvi;IZ9^9-sBPneC<^7!_t zho`QKA?(Q?Y5TnUMob<_)Jx*0|356i;kenuYvnG@=hUpKS9sIK+^(NN)^RC%(nWg{RDKRnd**N#T@0ki zWdGpw=~u9eb2e1;h1@ng4fJu_eUK~j~ Date: Wed, 26 Aug 2015 20:32:48 +0200 Subject: [PATCH 02/13] Adds styles for social share and auth --- app/assets/stylesheets/participacion.scss | 119 ++++++++++++++++++++++ app/views/devise/_omniauth_form.html.erb | 18 ++-- config/locales/devise_views.en.yml | 2 +- config/locales/devise_views.es.yml | 2 +- config/locales/en.yml | 3 + config/locales/es.yml | 3 + 6 files changed, 138 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/participacion.scss b/app/assets/stylesheets/participacion.scss index e20a2cb36..116b57ff8 100644 --- a/app/assets/stylesheets/participacion.scss +++ b/app/assets/stylesheets/participacion.scss @@ -14,6 +14,7 @@ // 12. Official levels // 13. Pagination // 14. Tables +// 15. Social // // 01. Variables @@ -856,4 +857,122 @@ table { } } +// 15. Social +// - - - - - - - - - - - - - - - - - - - - - - - - - +.button.button-twitter { + background: #45B0E3; + + &:before { + background: #40A2D1; + content: "f"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 0; + line-height: $line-height*2; + padding: 0 rem-calc(20); + position: absolute; + top: 0; + } +} + +.social-share-button-twitter { + background: #45B0E3; + color: white; + height: rem-calc(48); + position: relative; + width: rem-calc(48); + + &:before { + content: "f"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 50%; + line-height: $line-height*2; + margin-left: rem-calc(-11); + position: absolute; + top: 0; + } + + &:hover { + color: #40A2D1; + } +} + +.button.button-facebook { + background: #3B5998; + + &:before { + background: #354F88; + content: "A"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 0; + line-height: $line-height*2; + padding: 0 rem-calc(20); + position: absolute; + top: 0; + } +} + +.social-share-button-facebook { + background: #3B5998; + color: white; + height: rem-calc(48); + position: relative; + width: rem-calc(48); + + &:before { + content: "A"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 50%; + line-height: $line-height*2; + margin-left: rem-calc(-11); + position: absolute; + top: 0; + } + + &:hover { + color: #354F88; + } +} + +.button.button-google { + background: #DE4C34; + + &:before { + background: #CE3E26; + content: "B"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 0; + line-height: $line-height*2; + padding: 0 rem-calc(20); + position: absolute; + top: 0; + } +} + +.social-share-button-google_plus { + background: #DE4C34; + color: white; + height: rem-calc(48); + position: relative; + width: rem-calc(48); + + &:before { + content: "B"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 50%; + line-height: $line-height*2; + margin-left: rem-calc(-11); + position: absolute; + top: 0; + } + + &:hover { + color: #CE3E26; + } +} diff --git a/app/views/devise/_omniauth_form.html.erb b/app/views/devise/_omniauth_form.html.erb index fdd812b4f..63e73d160 100644 --- a/app/views/devise/_omniauth_form.html.erb +++ b/app/views/devise/_omniauth_form.html.erb @@ -1,7 +1,11 @@ -
- -<%= link_to t("omniauth.twitter.sign_in"), user_omniauth_authorize_path(:twitter), class: 'button radius expand' %> -<%= link_to t("omniauth.facebook.sign_in"), user_omniauth_authorize_path(:facebook), class: 'button radius expand' %> -<%= link_to t("omniauth.google_oauth2.sign_in"), user_omniauth_authorize_path(:google_oauth2), class: 'button radius expand' %> - -
+<% if current_page?(new_user_session_path) %> + <%= link_to t("omniauth.twitter.sign_in"), user_omniauth_authorize_path(:twitter), class: "button-twitter button radius expand" %> + <%= link_to t("omniauth.facebook.sign_in"), user_omniauth_authorize_path(:facebook), class: "button-facebook button radius expand" %> + <%= link_to t("omniauth.google_oauth2.sign_in"), user_omniauth_authorize_path(:google_oauth2), class: "button-google button radius expand" %> +
+<% elsif current_page?(new_user_registration_path) %> + <%= link_to t("omniauth.twitter.sign_up"), user_omniauth_authorize_path(:twitter), class: "button-twitter button radius expand" %> + <%= link_to t("omniauth.facebook.sign_up"), user_omniauth_authorize_path(:facebook), class: "button-facebook button radius expand" %> + <%= link_to t("omniauth.google_oauth2.sign_up"), user_omniauth_authorize_path(:google_oauth2), class: "button-google button radius expand" %> +
+<% end %> \ No newline at end of file diff --git a/config/locales/devise_views.en.yml b/config/locales/devise_views.en.yml index f0e1eb33a..e6f573cf3 100644 --- a/config/locales/devise_views.en.yml +++ b/config/locales/devise_views.en.yml @@ -55,7 +55,7 @@ en: password_label: "Password" password_confirmation_label: "Confirm password" submit: "Sign up" - organization_signup: "Do you represent an organization / group?" + organization_signup: "Do you represent an organization / group? Enter here" organizations: registrations: new: diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml index 49d304748..f955938d4 100644 --- a/config/locales/devise_views.es.yml +++ b/config/locales/devise_views.es.yml @@ -55,7 +55,7 @@ es: password_label: "Contraseña" password_confirmation_label: "Confirmar contraseña" submit: "Registrarse" - organization_signup: "¿Representas a una organización / colectivo?" + organization_signup: "¿Representas a una organización / colectivo? Entra aquí" organizations: registrations: new: diff --git a/config/locales/en.yml b/config/locales/en.yml index 322cf585f..049f15435 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -152,7 +152,10 @@ en: title: Add Email twitter: sign_in: Sign in with Twitter + sign_up: Sign up with Twitter facebook: sign_in: Sign in with Facebook + sign_up: Sign up with Facebook google_oauth2: sign_in: Sign in with Google + sign_up: Sign up with Google diff --git a/config/locales/es.yml b/config/locales/es.yml index 5c21c039e..58ae07441 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -152,7 +152,10 @@ es: title: Añade tu email twitter: sign_in: Entra con Twitter + sign_up: Regístrate con Twitter facebook: sign_in: Entra con Facebook + sign_up: Regístrate con Facebook google_oauth2: sign_in: Entra con Google + sign_up: Regístrate con Google From 9cd2297b67ce1b339692c9ffad7fe057764861bf Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 26 Aug 2015 20:36:52 +0200 Subject: [PATCH 03/13] Updates tests for social sign up --- spec/features/users_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index 1fa30bcbe..829dcba03 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -74,7 +74,7 @@ feature 'Users' do expect do expect do expect do - click_link 'Sign in with Twitter' + click_link 'Sign up with Twitter' end.not_to change { ActionMailer::Base.deliveries.size } end.to change { Identity.count }.by(1) end.to change { User.count }.by(1) @@ -109,7 +109,7 @@ feature 'Users' do expect do expect do expect do - click_link 'Sign in with Twitter' + click_link 'Sign up with Twitter' end.not_to change { ActionMailer::Base.deliveries.size } end.to change { Identity.count }.by(1) end.to change { User.count }.by(1) From 599ea9a19f654f4af3d2d74836d0a27f5893a71e Mon Sep 17 00:00:00 2001 From: kikito Date: Thu, 27 Aug 2015 14:23:34 +0200 Subject: [PATCH 04/13] force ssl in production --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index e84606f73..7a21a1df4 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -42,7 +42,7 @@ Rails.application.configure do # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true + config.force_ssl = true # Use the lowest log level to ensure availability of diagnostic information # when problems arise. From ccaca54816edb7e4e3519c31c87213c9e5cd6d48 Mon Sep 17 00:00:00 2001 From: Marko Lovic Date: Wed, 26 Aug 2015 00:06:05 +0200 Subject: [PATCH 05/13] Add filters to specify order of debates#index --- app/controllers/debates_controller.rb | 8 +++- app/models/debate.rb | 11 +++++ app/views/debates/_filter_selector.erb | 7 ++++ app/views/debates/index.html.erb | 13 +----- spec/features/debates_spec.rb | 57 ++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 app/views/debates/_filter_selector.erb diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index cf6d14f65..c0b23577d 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -1,11 +1,12 @@ class DebatesController < ApplicationController + before_action :parse_filter, only: :index before_action :authenticate_user!, except: [:index, :show] load_and_authorize_resource respond_to :html, :js def index - @debates = Debate.search(params).page(params[:page]).for_render + @debates = Debate.search(params).page(params[:page]).for_render.sort_by(@filter) set_debate_votes(@debates) end @@ -71,4 +72,9 @@ class DebatesController < ApplicationController @featured_tags = ActsAsTaggableOn::Tag.where(featured: true) end + def parse_filter + @valid_filters = ['votes', 'news', 'rated'] + @filter = @valid_filters.include?(params[:filter]) ? params[:filter] : 'news' + end + end diff --git a/app/models/debate.rb b/app/models/debate.rb index 15590fc60..194d6537b 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -40,6 +40,17 @@ class Debate < ActiveRecord::Base end end + def self.sort_by(filter) + case filter + when 'votes' + reorder(cached_votes_total: :desc) + when 'news' + reorder(created_at: :desc) + when 'rated' + reorder(cached_votes_up: :desc) + end + end + def likes cached_votes_up end diff --git a/app/views/debates/_filter_selector.erb b/app/views/debates/_filter_selector.erb new file mode 100644 index 000000000..fa26347f1 --- /dev/null +++ b/app/views/debates/_filter_selector.erb @@ -0,0 +1,7 @@ +<% options = @valid_filters.map { |f| [t("debates.index.filter_#{f}"), f] } %> + +<%= form_tag('/debates', method: 'get', class: 'inline-block') do %> + + <%= select_tag 'filter', options_for_select(options, @filter), onchange: "this.form.submit()" %> + +<% end %> diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index 59d11f37c..cf4205af6 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -4,18 +4,7 @@

<%= t("debates.index.showing") %>

- - + <%= render 'filter_selector' %>
diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 22b689308..748b36c73 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -350,4 +350,61 @@ feature 'Debates' do expect(InappropiateFlag.flagged?(user, debate)).to_not be end + feature 'Debate index order filters', :js do + + before do + @debates = [create(:debate), create(:debate), create(:debate)] + create_list(:vote, 2, votable: @debates[1]) + create_list(:vote, 2, votable: @debates[0], vote_flag: false) + create(:vote, votable: @debates[0]) + end + + def expect_debate_order(order) + debate_divs = page.all("#debates .debate") + (0..2).each do |n| + expect(debate_divs[n]).to have_content(@debates[order[n]].title) + end + end + + scenario 'Default filter is newest' do + visit debates_path + + expect(page).to have_select('filter', selected: 'the newest') + expect_debate_order([2, 1, 0]) + end + + scenario 'Debates are ordered by most voted' do + visit debates_path + + select 'the most voted', from: 'filter' + expect(page).to have_select('filter', selected: 'the most voted') + + expect(find("#debates .debate", match: :first)).to have_content(@debates[0].title) # Necessary to force capybara to wait for redirect + expect(current_url).to include('filter=votes') + expect_debate_order([0, 1, 2]) + end + + scenario 'Debates are ordered by best rated' do + visit debates_path + + select 'the best rated', from: 'filter' + expect(find("#debates .debate", match: :first)).to have_content(@debates[1].title) + + expect(current_url).to include('filter=rated') + expect_debate_order([1, 0, 2]) + end + + scenario 'Debates are ordered by newest' do + visit debates_path + + select 'the most voted', from: 'filter' + expect(find("#debates .debate", match: :first)).to have_content(@debates[0].title) + + select 'the newest', from: 'filter' + expect(find("#debates .debate", match: :first)).to have_content(@debates[2].title) + + expect(current_url).to include('filter=news') + expect_debate_order([2, 1, 0]) + end + end end From 2d48966de3806b749461cfdd8b131a7858016503 Mon Sep 17 00:00:00 2001 From: Marko Lovic Date: Thu, 27 Aug 2015 09:28:56 +0200 Subject: [PATCH 06/13] Change variable name and references from "filter" to "order" --- app/controllers/debates_controller.rb | 10 +++++----- app/models/debate.rb | 4 ++-- app/views/debates/_filter_selector.erb | 7 ------- app/views/debates/_order_selector.erb | 7 +++++++ app/views/debates/index.html.erb | 2 +- config/locales/en.yml | 6 +++--- config/locales/es.yml | 6 +++--- spec/features/debates_spec.rb | 20 ++++++++++---------- 8 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 app/views/debates/_filter_selector.erb create mode 100644 app/views/debates/_order_selector.erb diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index c0b23577d..7f7556f96 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -1,12 +1,12 @@ class DebatesController < ApplicationController - before_action :parse_filter, only: :index + before_action :parse_order, only: :index before_action :authenticate_user!, except: [:index, :show] load_and_authorize_resource respond_to :html, :js def index - @debates = Debate.search(params).page(params[:page]).for_render.sort_by(@filter) + @debates = Debate.search(params).page(params[:page]).for_render.sort_by(@order) set_debate_votes(@debates) end @@ -72,9 +72,9 @@ class DebatesController < ApplicationController @featured_tags = ActsAsTaggableOn::Tag.where(featured: true) end - def parse_filter - @valid_filters = ['votes', 'news', 'rated'] - @filter = @valid_filters.include?(params[:filter]) ? params[:filter] : 'news' + def parse_order + @valid_orders = ['votes', 'news', 'rated'] + @order = @valid_orders.include?(params[:order]) ? params[:order] : 'news' end end diff --git a/app/models/debate.rb b/app/models/debate.rb index 194d6537b..9b815c6db 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -40,8 +40,8 @@ class Debate < ActiveRecord::Base end end - def self.sort_by(filter) - case filter + def self.sort_by(order) + case order when 'votes' reorder(cached_votes_total: :desc) when 'news' diff --git a/app/views/debates/_filter_selector.erb b/app/views/debates/_filter_selector.erb deleted file mode 100644 index fa26347f1..000000000 --- a/app/views/debates/_filter_selector.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% options = @valid_filters.map { |f| [t("debates.index.filter_#{f}"), f] } %> - -<%= form_tag('/debates', method: 'get', class: 'inline-block') do %> - - <%= select_tag 'filter', options_for_select(options, @filter), onchange: "this.form.submit()" %> - -<% end %> diff --git a/app/views/debates/_order_selector.erb b/app/views/debates/_order_selector.erb new file mode 100644 index 000000000..6516a172d --- /dev/null +++ b/app/views/debates/_order_selector.erb @@ -0,0 +1,7 @@ +<% options = @valid_orders.map { |f| [t("debates.index.order_#{f}"), f] } %> + +<%= form_tag('/debates', method: 'get', class: 'inline-block') do %> + + <%= select_tag 'order', options_for_select(options, @order), onchange: "this.form.submit()" %> + +<% end %> diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index cf4205af6..13600160c 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -4,7 +4,7 @@

<%= t("debates.index.showing") %>

- <%= render 'filter_selector' %> + <%= render 'order_selector' %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 322cf585f..4bc7f33e3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -33,9 +33,9 @@ en: index: create_debate: Create a debate showing: You are seeing debates - filter_news: the newest - filter_votes: the most voted - filter_rated: the best rated + order_news: the newest + order_votes: the most voted + order_rated: the best rated filter_topic: "You are seeing %{number} debates with the topic '%{topic}'" debate: debate: Debate diff --git a/config/locales/es.yml b/config/locales/es.yml index 5c21c039e..dc133aaff 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -33,9 +33,9 @@ es: index: create_debate: Crea un debate showing: "Estás viendo los debates" - filter_news: "más nuevos" - filter_votes: "más votados" - filter_rated: mejor valorados + order_news: "más nuevos" + order_votes: "más votados" + order_rated: mejor valorados filter_topic: "Estás viendo %{number} debates con el tema '%{topic}'" debate: debate: Debate diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 748b36c73..c76e4971c 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -366,44 +366,44 @@ feature 'Debates' do end end - scenario 'Default filter is newest' do + scenario 'Default order is newest' do visit debates_path - expect(page).to have_select('filter', selected: 'the newest') + expect(page).to have_select('order', selected: 'the newest') expect_debate_order([2, 1, 0]) end scenario 'Debates are ordered by most voted' do visit debates_path - select 'the most voted', from: 'filter' - expect(page).to have_select('filter', selected: 'the most voted') + select 'the most voted', from: 'order' + expect(page).to have_select('order', selected: 'the most voted') expect(find("#debates .debate", match: :first)).to have_content(@debates[0].title) # Necessary to force capybara to wait for redirect - expect(current_url).to include('filter=votes') + expect(current_url).to include('order=votes') expect_debate_order([0, 1, 2]) end scenario 'Debates are ordered by best rated' do visit debates_path - select 'the best rated', from: 'filter' + select 'the best rated', from: 'order' expect(find("#debates .debate", match: :first)).to have_content(@debates[1].title) - expect(current_url).to include('filter=rated') + expect(current_url).to include('order=rated') expect_debate_order([1, 0, 2]) end scenario 'Debates are ordered by newest' do visit debates_path - select 'the most voted', from: 'filter' + select 'the most voted', from: 'order' expect(find("#debates .debate", match: :first)).to have_content(@debates[0].title) - select 'the newest', from: 'filter' + select 'the newest', from: 'order' expect(find("#debates .debate", match: :first)).to have_content(@debates[2].title) - expect(current_url).to include('filter=news') + expect(current_url).to include('order=news') expect_debate_order([2, 1, 0]) end end From 6f32801a88393e09617ca6045009026e750748d4 Mon Sep 17 00:00:00 2001 From: Marko Lovic Date: Thu, 27 Aug 2015 09:38:02 +0200 Subject: [PATCH 07/13] Change names of debate order filters * 'news' to 'created_at' * 'votes' to 'total_votes' * 'rated' to 'likes' --- app/controllers/debates_controller.rb | 4 ++-- app/models/debate.rb | 6 +++--- config/locales/en.yml | 6 +++--- config/locales/es.yml | 6 +++--- spec/features/debates_spec.rb | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index 7f7556f96..bc733c67a 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -73,8 +73,8 @@ class DebatesController < ApplicationController end def parse_order - @valid_orders = ['votes', 'news', 'rated'] - @order = @valid_orders.include?(params[:order]) ? params[:order] : 'news' + @valid_orders = ['total_votes', 'created_at', 'likes'] + @order = @valid_orders.include?(params[:order]) ? params[:order] : 'created_at' end end diff --git a/app/models/debate.rb b/app/models/debate.rb index 9b815c6db..82931dfff 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -42,11 +42,11 @@ class Debate < ActiveRecord::Base def self.sort_by(order) case order - when 'votes' + when 'total_votes' reorder(cached_votes_total: :desc) - when 'news' + when 'created_at' reorder(created_at: :desc) - when 'rated' + when 'likes' reorder(cached_votes_up: :desc) end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 4bc7f33e3..7e049594d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -33,9 +33,9 @@ en: index: create_debate: Create a debate showing: You are seeing debates - order_news: the newest - order_votes: the most voted - order_rated: the best rated + order_created_at: the newest + order_total_votes: the most voted + order_likes: the best rated filter_topic: "You are seeing %{number} debates with the topic '%{topic}'" debate: debate: Debate diff --git a/config/locales/es.yml b/config/locales/es.yml index dc133aaff..fce3bad63 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -33,9 +33,9 @@ es: index: create_debate: Crea un debate showing: "Estás viendo los debates" - order_news: "más nuevos" - order_votes: "más votados" - order_rated: mejor valorados + order_created_at: "más nuevos" + order_total_votes: "más votados" + order_likes: mejor valorados filter_topic: "Estás viendo %{number} debates con el tema '%{topic}'" debate: debate: Debate diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index c76e4971c..cf6c71829 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -366,7 +366,7 @@ feature 'Debates' do end end - scenario 'Default order is newest' do + scenario 'Default order is created_at' do visit debates_path expect(page).to have_select('order', selected: 'the newest') @@ -380,7 +380,7 @@ feature 'Debates' do expect(page).to have_select('order', selected: 'the most voted') expect(find("#debates .debate", match: :first)).to have_content(@debates[0].title) # Necessary to force capybara to wait for redirect - expect(current_url).to include('order=votes') + expect(current_url).to include('order=total_votes') expect_debate_order([0, 1, 2]) end @@ -390,7 +390,7 @@ feature 'Debates' do select 'the best rated', from: 'order' expect(find("#debates .debate", match: :first)).to have_content(@debates[1].title) - expect(current_url).to include('order=rated') + expect(current_url).to include('order=likes') expect_debate_order([1, 0, 2]) end @@ -403,7 +403,7 @@ feature 'Debates' do select 'the newest', from: 'order' expect(find("#debates .debate", match: :first)).to have_content(@debates[2].title) - expect(current_url).to include('order=news') + expect(current_url).to include('order=created_at') expect_debate_order([2, 1, 0]) end end From b6df3be8c0e00a406a84a66fea3eb674fbee6c8a Mon Sep 17 00:00:00 2001 From: Marko Lovic Date: Thu, 27 Aug 2015 12:42:05 +0200 Subject: [PATCH 08/13] Change Debate.sort_by method for individual scopes --- app/controllers/debates_controller.rb | 2 +- app/models/debate.rb | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index bc733c67a..efa441d81 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -6,7 +6,7 @@ class DebatesController < ApplicationController respond_to :html, :js def index - @debates = Debate.search(params).page(params[:page]).for_render.sort_by(@order) + @debates = Debate.search(params).page(params[:page]).for_render.send("sort_by_#{@order}") set_debate_votes(@debates) end diff --git a/app/models/debate.rb b/app/models/debate.rb index 82931dfff..779cca33a 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -28,6 +28,10 @@ class Debate < ActiveRecord::Base scope :archived, -> { where("archived_at IS NOT NULL AND hidden_at IS NULL") } scope :flagged_as_inappropiate, -> { where("inappropiate_flags_count > 0") } scope :for_render, -> { includes(:tags) } + scope :sort_by_total_votes, -> { reorder(cached_votes_total: :desc) } + scope :sort_by_likes , -> { reorder(cached_votes_up: :desc) } + scope :sort_by_created_at, -> { reorder(created_at: :desc) } + # Ahoy setup visitable # Ahoy will automatically assign visit_id on create @@ -40,17 +44,6 @@ class Debate < ActiveRecord::Base end end - def self.sort_by(order) - case order - when 'total_votes' - reorder(cached_votes_total: :desc) - when 'created_at' - reorder(created_at: :desc) - when 'likes' - reorder(cached_votes_up: :desc) - end - end - def likes cached_votes_up end From f5622b342573f0a127fab6c5c6908c788b6602d9 Mon Sep 17 00:00:00 2001 From: Marko Lovic Date: Thu, 27 Aug 2015 12:56:06 +0200 Subject: [PATCH 09/13] Assign each test debate to one variable --- spec/features/debates_spec.rb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index cf6c71829..dfafeb7db 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -353,16 +353,20 @@ feature 'Debates' do feature 'Debate index order filters', :js do before do - @debates = [create(:debate), create(:debate), create(:debate)] - create_list(:vote, 2, votable: @debates[1]) - create_list(:vote, 2, votable: @debates[0], vote_flag: false) - create(:vote, votable: @debates[0]) + # TODO consider using debate title literally + @most_voted_debate = create(:debate) + @most_liked_debate = create(:debate) + @most_recent_debate = create(:debate) + create_list(:vote, 2, votable: @most_liked_debate) + create_list(:vote, 2, votable: @most_voted_debate, vote_flag: false) + create(:vote, votable: @most_voted_debate) end def expect_debate_order(order) + debates = [@most_voted_debate, @most_liked_debate, @most_recent_debate] debate_divs = page.all("#debates .debate") (0..2).each do |n| - expect(debate_divs[n]).to have_content(@debates[order[n]].title) + expect(debate_divs[n]).to have_content(debates[order[n]].title) end end @@ -379,7 +383,7 @@ feature 'Debates' do select 'the most voted', from: 'order' expect(page).to have_select('order', selected: 'the most voted') - expect(find("#debates .debate", match: :first)).to have_content(@debates[0].title) # Necessary to force capybara to wait for redirect + expect(find("#debates .debate", match: :first)).to have_content(@most_voted_debate.title) # Necessary to force capybara to wait for redirect expect(current_url).to include('order=total_votes') expect_debate_order([0, 1, 2]) end @@ -388,7 +392,7 @@ feature 'Debates' do visit debates_path select 'the best rated', from: 'order' - expect(find("#debates .debate", match: :first)).to have_content(@debates[1].title) + expect(find("#debates .debate", match: :first)).to have_content(@most_liked_debate.title) expect(current_url).to include('order=likes') expect_debate_order([1, 0, 2]) @@ -398,10 +402,10 @@ feature 'Debates' do visit debates_path select 'the most voted', from: 'order' - expect(find("#debates .debate", match: :first)).to have_content(@debates[0].title) + expect(find("#debates .debate", match: :first)).to have_content(@most_voted_debate.title) select 'the newest', from: 'order' - expect(find("#debates .debate", match: :first)).to have_content(@debates[2].title) + expect(find("#debates .debate", match: :first)).to have_content(@most_recent_debate.title) expect(current_url).to include('order=created_at') expect_debate_order([2, 1, 0]) From bfeff8d24193a63693ff5f2b322c84683f21d51c Mon Sep 17 00:00:00 2001 From: Marko Lovic Date: Thu, 27 Aug 2015 13:54:18 +0200 Subject: [PATCH 10/13] Implement custom rspec matcher appear_before --- spec/features/debates_spec.rb | 21 +++++++++------------ spec/features/moderation_spec.rb | 1 + spec/support/matchers/appear_before.rb | 6 ++++++ 3 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 spec/support/matchers/appear_before.rb diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index dfafeb7db..8904199b3 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -362,19 +362,13 @@ feature 'Debates' do create(:vote, votable: @most_voted_debate) end - def expect_debate_order(order) - debates = [@most_voted_debate, @most_liked_debate, @most_recent_debate] - debate_divs = page.all("#debates .debate") - (0..2).each do |n| - expect(debate_divs[n]).to have_content(debates[order[n]].title) - end - end - scenario 'Default order is created_at' do visit debates_path expect(page).to have_select('order', selected: 'the newest') - expect_debate_order([2, 1, 0]) + #expect_debate_order([2, 1, 0]) + expect(@most_recent_debate.title).to appear_before(@most_liked_debate.title) + expect(@most_liked_debate.title).to appear_before(@most_voted_debate.title) end scenario 'Debates are ordered by most voted' do @@ -385,7 +379,8 @@ feature 'Debates' do expect(find("#debates .debate", match: :first)).to have_content(@most_voted_debate.title) # Necessary to force capybara to wait for redirect expect(current_url).to include('order=total_votes') - expect_debate_order([0, 1, 2]) + expect(@most_voted_debate.title).to appear_before(@most_liked_debate.title) + expect(@most_liked_debate.title).to appear_before(@most_recent_debate.title) end scenario 'Debates are ordered by best rated' do @@ -395,7 +390,8 @@ feature 'Debates' do expect(find("#debates .debate", match: :first)).to have_content(@most_liked_debate.title) expect(current_url).to include('order=likes') - expect_debate_order([1, 0, 2]) + expect(@most_liked_debate.title).to appear_before(@most_voted_debate.title) + expect(@most_voted_debate.title).to appear_before(@most_recent_debate.title) end scenario 'Debates are ordered by newest' do @@ -408,7 +404,8 @@ feature 'Debates' do expect(find("#debates .debate", match: :first)).to have_content(@most_recent_debate.title) expect(current_url).to include('order=created_at') - expect_debate_order([2, 1, 0]) + expect(@most_recent_debate.title).to appear_before(@most_liked_debate.title) + expect(@most_liked_debate.title).to appear_before(@most_voted_debate.title) end end end diff --git a/spec/features/moderation_spec.rb b/spec/features/moderation_spec.rb index 78df5e56f..aa49d381c 100644 --- a/spec/features/moderation_spec.rb +++ b/spec/features/moderation_spec.rb @@ -1,4 +1,5 @@ require 'rails_helper' +require 'support/matchers/appear_before' feature 'Admin' do let(:user) { create(:user) } diff --git a/spec/support/matchers/appear_before.rb b/spec/support/matchers/appear_before.rb new file mode 100644 index 000000000..bb1d65072 --- /dev/null +++ b/spec/support/matchers/appear_before.rb @@ -0,0 +1,6 @@ +RSpec::Matchers.define :appear_before do |later_content| + match do |earlier_content| + page.body.index(earlier_content) < page.body.index(later_content) + end +end + From ec7da859496c0be0ddd5a5adf41e8c6c41ffd8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Thu, 27 Aug 2015 16:13:40 +0200 Subject: [PATCH 11/13] updates uglier version (security bug release) --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 94e26694c..cd2ae196d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -130,7 +130,7 @@ GEM mail (~> 2.2) errbase (0.0.3) erubis (2.7.0) - execjs (2.5.2) + execjs (2.6.0) factory_girl (4.5.0) activesupport (>= 3.0.0) factory_girl_rails (4.5.0) @@ -338,7 +338,7 @@ GEM coffee-rails tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (2.7.1) + uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) unf (0.1.4) From e8004ca1d3c5e6c6d64b48a0d440bf6e165ed16a Mon Sep 17 00:00:00 2001 From: Marko Lovic Date: Thu, 27 Aug 2015 14:54:04 +0200 Subject: [PATCH 12/13] Add to javascript to handle debates order change --- app/assets/javascripts/application.js | 1 + .../debates_order_selector.js.coffee | 17 +++++++++++++++++ app/helpers/debates_helper.rb | 12 ++++++++++++ app/views/debates/_order_selector.erb | 12 +++++------- spec/features/debates_spec.rb | 14 ++++++-------- spec/features/moderation_spec.rb | 1 - 6 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 app/assets/javascripts/debates_order_selector.js.coffee create mode 100644 app/helpers/debates_helper.rb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index a5aaf5c01..6e5b1df3d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -32,6 +32,7 @@ var initialize_modules = function() { App.Tags.initialize(); App.Stats.initialize(); App.LocaleSwitcher.initialize(); + App.DebatesOrderSelector.initialize(); }; $(function(){ diff --git a/app/assets/javascripts/debates_order_selector.js.coffee b/app/assets/javascripts/debates_order_selector.js.coffee new file mode 100644 index 000000000..94002f5ac --- /dev/null +++ b/app/assets/javascripts/debates_order_selector.js.coffee @@ -0,0 +1,17 @@ +App.DebatesOrderSelector = + + href_with_params: (query_params) -> + loc = window.location + + loc.protocol + "//" + loc.hostname + + (if loc.port then ':' + loc.port else '') + + loc.pathname + + loc.hash + + '?' + $.param(query_params) + + initialize: -> + $('.js-order-selector').on 'change', -> + query_params = window.getQueryParameters() + query_params['order'] = $(this).val() + window.location.assign(App.DebatesOrderSelector.href_with_params(query_params)) + diff --git a/app/helpers/debates_helper.rb b/app/helpers/debates_helper.rb new file mode 100644 index 000000000..52bb9c17c --- /dev/null +++ b/app/helpers/debates_helper.rb @@ -0,0 +1,12 @@ +module DebatesHelper + def available_options_for_order_selector(valid_orders, current_order) + options_for_select(available_order_filters_array(valid_orders), current_order) + end + + private + + def available_order_filters_array(orders) + orders.map { |f| [t("debates.index.order_#{f}"), f] } + end + +end diff --git a/app/views/debates/_order_selector.erb b/app/views/debates/_order_selector.erb index 6516a172d..de18cfc45 100644 --- a/app/views/debates/_order_selector.erb +++ b/app/views/debates/_order_selector.erb @@ -1,7 +1,5 @@ -<% options = @valid_orders.map { |f| [t("debates.index.order_#{f}"), f] } %> - -<%= form_tag('/debates', method: 'get', class: 'inline-block') do %> - - <%= select_tag 'order', options_for_select(options, @order), onchange: "this.form.submit()" %> - -<% end %> +
+ +
diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 8904199b3..82669770d 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -365,17 +365,15 @@ feature 'Debates' do scenario 'Default order is created_at' do visit debates_path - expect(page).to have_select('order', selected: 'the newest') - #expect_debate_order([2, 1, 0]) + expect(page).to have_select('order-selector', selected: 'the newest') expect(@most_recent_debate.title).to appear_before(@most_liked_debate.title) - expect(@most_liked_debate.title).to appear_before(@most_voted_debate.title) end scenario 'Debates are ordered by most voted' do visit debates_path - select 'the most voted', from: 'order' - expect(page).to have_select('order', selected: 'the most voted') + select 'the most voted', from: 'order-selector' + expect(page).to have_select('order-selector', selected: 'the most voted') expect(find("#debates .debate", match: :first)).to have_content(@most_voted_debate.title) # Necessary to force capybara to wait for redirect expect(current_url).to include('order=total_votes') @@ -386,7 +384,7 @@ feature 'Debates' do scenario 'Debates are ordered by best rated' do visit debates_path - select 'the best rated', from: 'order' + select 'the best rated', from: 'order-selector' expect(find("#debates .debate", match: :first)).to have_content(@most_liked_debate.title) expect(current_url).to include('order=likes') @@ -397,10 +395,10 @@ feature 'Debates' do scenario 'Debates are ordered by newest' do visit debates_path - select 'the most voted', from: 'order' + select 'the most voted', from: 'order-selector' expect(find("#debates .debate", match: :first)).to have_content(@most_voted_debate.title) - select 'the newest', from: 'order' + select 'the newest', from: 'order-selector' expect(find("#debates .debate", match: :first)).to have_content(@most_recent_debate.title) expect(current_url).to include('order=created_at') diff --git a/spec/features/moderation_spec.rb b/spec/features/moderation_spec.rb index aa49d381c..78df5e56f 100644 --- a/spec/features/moderation_spec.rb +++ b/spec/features/moderation_spec.rb @@ -1,5 +1,4 @@ require 'rails_helper' -require 'support/matchers/appear_before' feature 'Admin' do let(:user) { create(:user) } From 1d997d49290c7ca650fec70b2e81ef8cb814ef4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Thu, 27 Aug 2015 18:07:57 +0200 Subject: [PATCH 13/13] fixes build, changes i18n ignored keys and specs ref: #254 --- app/helpers/debates_helper.rb | 2 +- config/i18n-tasks.yml | 1 + config/locales/en.yml | 7 ++++--- config/locales/es.yml | 7 ++++--- spec/features/debates_spec.rb | 29 +++++++++++++++-------------- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/app/helpers/debates_helper.rb b/app/helpers/debates_helper.rb index 52bb9c17c..c594a8fa6 100644 --- a/app/helpers/debates_helper.rb +++ b/app/helpers/debates_helper.rb @@ -6,7 +6,7 @@ module DebatesHelper private def available_order_filters_array(orders) - orders.map { |f| [t("debates.index.order_#{f}"), f] } + orders.map { |f| [t("debates.index.orders.#{f}"), f] } end end diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index dd5b7f0c4..d45c73d9b 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -102,6 +102,7 @@ ignore_unused: - 'admin.officials.level_*' - 'helpers.page_entries_info.*' # kaminari - 'views.pagination.*' # kaminari + - 'debates.index.orders.*' #order filters for debates # - '{devise,kaminari,will_paginate}.*' # - 'simple_form.{yes,no}' # - 'simple_form.{placeholders,hints,labels}.*' diff --git a/config/locales/en.yml b/config/locales/en.yml index c1d872ea1..a255991da 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -33,9 +33,10 @@ en: index: create_debate: Create a debate showing: You are seeing debates - order_created_at: the newest - order_total_votes: the most voted - order_likes: the best rated + orders: + created_at: newest + total_votes: most voted + likes: best rated filter_topic: "You are seeing %{number} debates with the topic '%{topic}'" debate: debate: Debate diff --git a/config/locales/es.yml b/config/locales/es.yml index c116b7899..f37bc0545 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -33,9 +33,10 @@ es: index: create_debate: Crea un debate showing: "Estás viendo los debates" - order_created_at: "más nuevos" - order_total_votes: "más votados" - order_likes: mejor valorados + orders: + created_at: "más nuevos" + total_votes: "más votados" + likes: mejor valorados filter_topic: "Estás viendo %{number} debates con el tema '%{topic}'" debate: debate: Debate diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 82669770d..b9e174915 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -352,8 +352,7 @@ feature 'Debates' do feature 'Debate index order filters', :js do - before do - # TODO consider using debate title literally + before do @most_voted_debate = create(:debate) @most_liked_debate = create(:debate) @most_recent_debate = create(:debate) @@ -365,18 +364,18 @@ feature 'Debates' do scenario 'Default order is created_at' do visit debates_path - expect(page).to have_select('order-selector', selected: 'the newest') + expect(page).to have_select('order-selector', selected: 'newest') expect(@most_recent_debate.title).to appear_before(@most_liked_debate.title) end - scenario 'Debates are ordered by most voted' do + scenario 'Debates are ordered by most voted' do visit debates_path - select 'the most voted', from: 'order-selector' - expect(page).to have_select('order-selector', selected: 'the most voted') + select 'most voted', from: 'order-selector' + expect(page).to have_select('order-selector', selected: 'most voted') + expect(find("#debates .debate", match: :first)).to have_content(@most_voted_debate.title) - expect(find("#debates .debate", match: :first)).to have_content(@most_voted_debate.title) # Necessary to force capybara to wait for redirect - expect(current_url).to include('order=total_votes') + expect(current_url).to include('order=total_votes') expect(@most_voted_debate.title).to appear_before(@most_liked_debate.title) expect(@most_liked_debate.title).to appear_before(@most_recent_debate.title) end @@ -384,10 +383,11 @@ feature 'Debates' do scenario 'Debates are ordered by best rated' do visit debates_path - select 'the best rated', from: 'order-selector' - expect(find("#debates .debate", match: :first)).to have_content(@most_liked_debate.title) + select 'best rated', from: 'order-selector' + expect(page).to have_select('order-selector', selected: 'best rated') + expect(find("#debates .debate", match: :first)).to have_content(@most_liked_debate.title) - expect(current_url).to include('order=likes') + expect(current_url).to include('order=likes') expect(@most_liked_debate.title).to appear_before(@most_voted_debate.title) expect(@most_voted_debate.title).to appear_before(@most_recent_debate.title) end @@ -395,13 +395,14 @@ feature 'Debates' do scenario 'Debates are ordered by newest' do visit debates_path - select 'the most voted', from: 'order-selector' + select 'most voted', from: 'order-selector' expect(find("#debates .debate", match: :first)).to have_content(@most_voted_debate.title) - select 'the newest', from: 'order-selector' + select 'newest', from: 'order-selector' + expect(page).to have_select('order-selector', selected: 'newest') expect(find("#debates .debate", match: :first)).to have_content(@most_recent_debate.title) - expect(current_url).to include('order=created_at') + expect(current_url).to include('order=created_at') expect(@most_recent_debate.title).to appear_before(@most_liked_debate.title) expect(@most_liked_debate.title).to appear_before(@most_voted_debate.title) end