aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/referentials_controller_spec.rb
diff options
context:
space:
mode:
authorTeddy Wing2017-12-18 17:23:04 +0100
committerTeddy Wing2017-12-18 17:35:57 +0100
commit1b690a6dbd7175eb29e543246a057e4a868974cd (patch)
tree31994add59c03612940eae78726e7a29b67034a7 /spec/controllers/referentials_controller_spec.rb
parent5ecfe32c539527017ab03b96b4a14b1daccac54c (diff)
downloadchouette-core-1b690a6dbd7175eb29e543246a057e4a868974cd.tar.bz2
Referentials#create: Add flash message on referential duplication
When a "duplicate referential" action is initiated, show a flash message to let users know that it started and is in progress (and will take a while since it's an asynchronous task). Refs #5317
Diffstat (limited to 'spec/controllers/referentials_controller_spec.rb')
-rw-r--r--spec/controllers/referentials_controller_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/controllers/referentials_controller_spec.rb b/spec/controllers/referentials_controller_spec.rb
index dad2b3c8f..4050a8812 100644
--- a/spec/controllers/referentials_controller_spec.rb
+++ b/spec/controllers/referentials_controller_spec.rb
@@ -42,4 +42,21 @@ describe ReferentialsController, :type => :controller do
)
end
end
+
+ describe "POST #create" do
+ context "when duplicating" do
+ it "displays a flash message" do
+ post :create,
+ from: referential.id,
+ current_workbench_id: referential.workbench_id,
+ referential: {
+ name: 'Duplicated'
+ }
+
+ expect(controller).to set_flash[:notice].to(
+ I18n.t('notice.referentials.duplicate')
+ )
+ end
+ end
+ end
end