forked from jamescook/RubyRedditAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to approve, hide, and remove comments.
- Loading branch information
james cook
committed
Sep 29, 2010
1 parent
802f904
commit a4b6917
Showing
5 changed files
with
79 additions
and
13 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Feature: Comments | ||
I want to be able to comment on a comment | ||
I want to be able to delete my comments | ||
|
||
Scenario: Valid comment text | ||
Given I enter some text | ||
Then I should be able to add a comment | ||
|
||
Scenario: I want to hide a comment | ||
Given I have a comment | ||
Then I should be able to hide the comment | ||
|
||
Scenario: I want to remove a comment | ||
Given I have a comment | ||
Then I should be able to remove the comment | ||
|
||
Scenario: I want to approve a comment | ||
Given I have a comment | ||
Then I should be able to approve the comment |
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,36 @@ | ||
Before do | ||
load_server_config | ||
Reddit::Api.base_uri @address | ||
Reddit::Submission.base_uri @address | ||
Reddit::Comment.base_uri @address | ||
@api = Reddit::Api.new @user, @pass | ||
@api.login | ||
@submission ||= @api.browse("reddit_test0")[0] | ||
end | ||
|
||
Given /^I enter some text$/ do | ||
@text = "SOME COMMENT" | ||
end | ||
|
||
Then /^I should be able to add a comment$/ do | ||
@submission.add_comment(@text).should be true | ||
end | ||
|
||
Given /^I have a comment$/ do | ||
@submission.add_comment("a comment") | ||
@comment = @submission.comments.last | ||
end | ||
|
||
Then /^I should be able to hide the comment$/ do | ||
@comment.hide | ||
end | ||
|
||
Then /^I should be able to remove the comment$/ do | ||
@comment.remove | ||
end | ||
|
||
Then /^I should be able to approve the comment$/ do | ||
@comment.approve | ||
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
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