summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/groups_controller_spec.rb8
-rw-r--r--spec/controllers/projects_controller_spec.rb8
-rw-r--r--spec/controllers/users_controller_spec.rb12
3 files changed, 20 insertions, 8 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb
index df8ea225814..15dae3231ca 100644
--- a/spec/controllers/groups_controller_spec.rb
+++ b/spec/controllers/groups_controller_spec.rb
@@ -101,7 +101,7 @@ describe GroupsController do
get :issues, id: redirect_route.path
expect(response).to redirect_to(issues_group_path(group.to_param))
- expect(controller).to set_flash[:notice].to(/moved/)
+ expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
end
end
@@ -146,7 +146,7 @@ describe GroupsController do
get :merge_requests, id: redirect_route.path
expect(response).to redirect_to(merge_requests_group_path(group.to_param))
- expect(controller).to set_flash[:notice].to(/moved/)
+ expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
end
end
@@ -249,4 +249,8 @@ describe GroupsController do
end
end
end
+
+ def group_moved_message(redirect_route, group)
+ "Group '#{redirect_route.path}' was moved to '#{group.full_path}'. Please update any links and bookmarks that may still have the old path."
+ end
end
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index e46ef447df2..e230944d52e 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -227,7 +227,7 @@ describe ProjectsController do
get :show, namespace_id: 'foo', id: 'bar'
expect(response).to redirect_to(public_project)
- expect(controller).to set_flash[:notice].to(/moved/)
+ expect(controller).to set_flash[:notice].to(project_moved_message(redirect_route, public_project))
end
end
end
@@ -473,7 +473,7 @@ describe ProjectsController do
get :refs, namespace_id: 'foo', id: 'bar'
expect(response).to redirect_to(refs_namespace_project_path(namespace_id: public_project.namespace, id: public_project))
- expect(controller).to set_flash[:notice].to(/moved/)
+ expect(controller).to set_flash[:notice].to(project_moved_message(redirect_route, public_project))
end
end
end
@@ -487,4 +487,8 @@ describe ProjectsController do
expect(JSON.parse(response.body).keys).to match_array(%w(body references))
end
end
+
+ def project_moved_message(redirect_route, project)
+ "Project '#{redirect_route.path}' was moved to '#{project.full_path}'. Please update any links and bookmarks that may still have the old path."
+ end
end
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index 74c5aa44ba9..1d61719f1d0 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -83,7 +83,7 @@ describe UsersController do
get :show, username: redirect_route.path
expect(response).to redirect_to(user)
- expect(controller).to set_flash[:notice].to(/moved/)
+ expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user))
end
end
@@ -162,7 +162,7 @@ describe UsersController do
get :calendar, username: redirect_route.path
expect(response).to redirect_to(user_calendar_path(user))
- expect(controller).to set_flash[:notice].to(/moved/)
+ expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user))
end
end
end
@@ -216,7 +216,7 @@ describe UsersController do
get :calendar_activities, username: redirect_route.path
expect(response).to redirect_to(user_calendar_activities_path(user))
- expect(controller).to set_flash[:notice].to(/moved/)
+ expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user))
end
end
end
@@ -270,7 +270,7 @@ describe UsersController do
get :snippets, username: redirect_route.path
expect(response).to redirect_to(user_snippets_path(user))
- expect(controller).to set_flash[:notice].to(/moved/)
+ expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user))
end
end
end
@@ -320,4 +320,8 @@ describe UsersController do
end
end
end
+
+ def user_moved_message(redirect_route, user)
+ "User '#{redirect_route.path}' was moved to '#{user.full_path}'. Please update any links and bookmarks that may still have the old path."
+ end
end