makes 'pending' filter the default in /moderation

This commit is contained in:
Juanjo Bazán
2015-09-04 22:38:22 +02:00
parent ded656837e
commit 4ef2ed753d
4 changed files with 10 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
class Moderation::CommentsController < Moderation::BaseController class Moderation::CommentsController < Moderation::BaseController
has_filters %w{all pending_flag_review with_ignored_flag}, only: :index has_filters %w{pending_flag_review all with_ignored_flag}, only: :index
before_action :load_comments, only: :index before_action :load_comments, only: :index

View File

@@ -1,5 +1,5 @@
class Moderation::DebatesController < Moderation::BaseController class Moderation::DebatesController < Moderation::BaseController
has_filters %w{all pending_flag_review with_ignored_flag}, only: :index has_filters %w{pending_flag_review all with_ignored_flag}, only: :index
before_action :load_debates, only: :index before_action :load_debates, only: :index

View File

@@ -102,8 +102,8 @@ feature 'Moderate Comments' do
scenario "Current filter is properly highlighted" do scenario "Current filter is properly highlighted" do
visit moderation_comments_path visit moderation_comments_path
expect(page).to_not have_link('All') expect(page).to_not have_link('Pending')
expect(page).to have_link('Pending') expect(page).to have_link('All')
expect(page).to have_link('Ignored') expect(page).to have_link('Ignored')
visit moderation_comments_path(filter: 'all') visit moderation_comments_path(filter: 'all')
@@ -191,6 +191,8 @@ feature 'Moderate Comments' do
expect(current_path).to eq(moderation_comments_path) expect(current_path).to eq(moderation_comments_path)
click_link('Ignored')
within("#comment_#{@comment.id}") do within("#comment_#{@comment.id}") do
expect(page).to have_content('Ignored') expect(page).to have_content('Ignored')
end end

View File

@@ -45,8 +45,8 @@ feature 'Moderate debates' do
scenario "Current filter is properly highlighted" do scenario "Current filter is properly highlighted" do
visit moderation_debates_path visit moderation_debates_path
expect(page).to_not have_link('All') expect(page).to_not have_link('Pending')
expect(page).to have_link('Pending') expect(page).to have_link('All')
expect(page).to have_link('Ignored') expect(page).to have_link('Ignored')
visit moderation_debates_path(filter: 'all') visit moderation_debates_path(filter: 'all')
@@ -133,6 +133,8 @@ feature 'Moderate debates' do
expect(current_path).to eq(moderation_debates_path) expect(current_path).to eq(moderation_debates_path)
click_link('All')
within("#debate_#{@debate.id}") do within("#debate_#{@debate.id}") do
expect(page).to have_content('Ignored') expect(page).to have_content('Ignored')
end end