forked from radar/rboard
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The params that come from the selected topics on the forum show page …
…are params[:moderated_topics]. Use these.
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Then /^I should see (\d+) sticky topics?$/ do |num| | ||
Nokogiri::HTML(response.body).xpath("//img[@src]").select { |i| i['src'].match(/sticky/) }.size.should eql(num.to_i) | ||
end | ||
|
||
Then /^I should see (\d+) locked topics?$/ do |num| | ||
p Topic.all.map(&:locked) | ||
Nokogiri::HTML(response.body).xpath("//img[@src]").select { |i| i['src'].match(/locked/) }.size.should eql(num.to_i) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Feature: Topics moderation | ||
In order to lock, delete, sticky and merge topics | ||
As a person who's able to do that | ||
I want the buttons to work for me | ||
|
||
Background: | ||
Given there is the usual setup | ||
|
||
Scenario: Locking selected topics | ||
Given I am logged in as "administrator" with the password "godly" | ||
And I am on the homepage | ||
When I follow "Public Forum" | ||
Then I should see 0 locked topics | ||
When I select "Default topic" for moderation | ||
And I press "Lock" | ||
Then I should see "All selected topics have been locked." | ||
Then I should see 1 locked topic |