Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: diaspora/diaspora
...
head fork: diaspora/diaspora
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 26, 2012
@Raven24 Raven24 [reshares] display flash message instead of just appending it to the …
…stream (fixes #2094)
0dee8aa
Commits on Apr 27, 2012
@Raven24 Raven24 added tests for flash messages on reshares 979eb66
Commits on Apr 28, 2012
@Raven24 Raven24 Merge pull request #3190 from diaspora/reshare-flash
use flash message instead of just appending reshares to the current stream
462959f
View
6 app/assets/javascripts/app/views/feedback_view.js
@@ -39,7 +39,11 @@ app.views.Feedback = app.views.Base.extend({
reshare.save({}, {
url: this.model.createReshareUrl,
success : function(resp){
- app.stream && app.stream.add(reshare);
+ var flash = new Diaspora.Widgets.FlashMessages;
+ flash.render({
+ success: true,
+ notice: Diaspora.I18n.t("reshares.successful")
+ });
model.trigger("interacted")
}
});
View
1  config/locales/javascript/javascript.en.yml
@@ -60,6 +60,7 @@ en:
hide: "hide comments"
reshares:
duplicate: "That good, huh? You've already reshared that post!"
+ successful: "The post was successfully reshared!"
aspect_navigation:
select_all: "Select all"
deselect_all: "Deselect all"
View
8 features/reshare.feature
@@ -18,9 +18,5 @@ Feature: public repost
And I preemptively confirm the alert
And I follow "Reshare"
And I wait for the ajax to finish
- And I wait for 2 seconds
-
- When I am on "alice@alice.alice"'s page
- Then I should see "reshare this!"
- Then I should see a ".reshare"
- And I should see "Bob"
+ Then I should see a flash message indicating success
+ And I should see a flash message containing "successfully"
View
12 features/step_definitions/custom_web_steps.rb
@@ -204,3 +204,15 @@
Then /^I should not see ajax loader on deletion link place$/ do
page.evaluate_script("$('.hide_loader').first().css('display')").should == "none"
end
+
+Then /^I should see a flash message indicating success$/ do
+ flash_message_success?
+end
+
+Then /^I should see a flash message indicating failure$/ do
+ flash_message_failure?
+end
+
+Then /^I should see a flash message containing "(.+)"$/ do |text|
+ flash_message_containing? text
+end
View
20 features/support/application_cuke_helpers.rb
@@ -0,0 +1,20 @@
+module ApplicationCukeHelpers
+ def flash_message_success?
+ flash_message("notice").visible?
+ end
+
+ def flash_message_failure?
+ flash_message("error").visible?
+ end
+
+ def flash_message_containing?(text)
+ flash_message.should have_content(text)
+ end
+
+ def flash_message(selector=".message")
+ selector = "#flash_#{selector}" unless selector == ".message"
+ find(selector)
+ end
+end
+
+World(ApplicationCukeHelpers)

No commit comments for this range

Something went wrong with that request. Please try again.