Commit 83a9877d authored by flaburgan's avatar flaburgan Committed by Jonne Haß

Improve likes steps

closes #8002
parent 554faa41
......@@ -2,7 +2,7 @@
## Refactor
* Enable paranoid mode for devise [#8003](https://github.com/diaspora/diaspora/pull/8003)
* Refactor likes cucumber test [#8002](https://github.com/diaspora/diaspora/pull/8002)
## Bug fixes
## Features
......
......@@ -16,13 +16,14 @@ Feature: Liking posts
Scenario: Liking and unliking a post from the stream
Then I should not have activated notifications for the post
When I like the post "I like unicorns" in the stream
Then I should see "Unlike" within ".stream-element .feedback"
And I should see a ".likes .media" within "#main-stream .stream-element"
Then the post "I like unicorns" should have the "Unlike" action available
And the post "I like unicorns" should have 1 like
And the post "I like unicorns" should have a like from "Alice Smith"
And I should have activated notifications for the post
When I unlike the post "I like unicorns" in the stream
Then I should see "Like" within ".stream-element .feedback"
And I should not see a ".likes .media" within "#main-stream .stream-element"
Then the post "I like unicorns" should have the "Like" action available
And the post "I like unicorns" shouldn't have any likes
Scenario: Liking and unliking a post from a single post page
......@@ -39,4 +40,6 @@ Feature: Liking posts
When I like the post "I like unicorns" in the stream
And I sign out
And I sign in as "bob@bob.bob"
Then I should see a ".likes" within "#main-stream .stream-element"
Then the post "I like unicorns" should have the "Like" action available
And the post "I like unicorns" should have 1 like
And the post "I like unicorns" should have a like from "Alice Smith"
......@@ -11,7 +11,7 @@ Given /^I have configured a Bitcoin address$/ do
end
Then /^I should see the Bitcoin address$/ do
find("#bitcoin_address")['value'].should == "AAAAAA"
find("#bitcoin_address")["value"].should == "AAAAAA"
end
Given /^I have configured a Liberapay username$/ do
......
......@@ -70,5 +70,6 @@ When /^I select "([^"]*)" on the aspect dropdown$/ do |text|
var elem = $(el);
if ('" + text + "' == $.trim(elem.text()) ) {
elem.click();
}});")
}});"
)
end
......@@ -4,6 +4,35 @@ When /^I (?:like|unlike) the post "([^"]*)" in the stream$/ do |post_text|
like_stream_post(post_text)
end
Then /^the post "([^"]*)" should have the "([^"]*)" action available$/ do |post_text, action_text|
within_post(post_text) do
find(".feedback").should have_content(action_text)
end
end
Then /^the post "([^"]*)" shouldn't have any likes$/ do |post_text|
within_post(post_text) do
find(".likes").should have_no_css(".avatar", visible: true)
end
end
Then /^the post "([^"]*)" should have (\d+) like(?:s|)$/ do |post_text, likes_number|
within_post(post_text) do
find(".expand-likes").should have_content(likes_number)
end
end
Then /^the post "([^"]*)" should have a like from "([^"]*)"$/ do |post_text, username|
within_post(post_text) do
find(".expand-likes").click
find(".likes .avatar")["data-original-title"].should have_content(username)
end
end
Then /^I should see an image in the publisher$/ do
photo_in_publisher.should be_present
end
Then /^"([^"]*)" should be post (\d+)$/ do |post_text, position|
stream_element_numbers_content(position).should have_content(post_text)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment