Skip to content
Extraits de code Groupes Projets
Valider 462959fb rédigé par Florian Staudacher's avatar Florian Staudacher
Parcourir les fichiers

Merge pull request #3190 from diaspora/reshare-flash

use flash message instead of just appending reshares to the current stream
parents 008ed32e 979eb66e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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")
}
});
......
......@@ -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"
......
......@@ -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"
......@@ -204,3 +204,15 @@ end
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
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)
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter