diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-10-17 21:37:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-10-17 21:47:46 +0300 |
commit | 285172c33c6acd66af284d8f1e97a41079fe90de (patch) | |
tree | 576b7762fc4faba72f43ab766ddc90f7317e6a3d /spec | |
parent | 11485c5acc9247e417838879a31af014972b999c (diff) | |
parent | a5f5c02598d189428c583572d42f38e478669771 (diff) |
Merge branch 'dz-rename-user-routes' into 'master'
Rename users routing from /u/:username to /users/:username for
consistency with other routes
Renames /u/:username to /users/:username
To follow consistency with other routes (like groups) and
UsersController name.
Now when you can use `/:username` for accessing user page there is no
need in shortcut like `/u/`
See merge request !6851
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/users_spec.rb | 12 | ||||
-rw-r--r-- | spec/routing/routing_spec.rb | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index ec4c4d62f53..111ca7f7a70 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -51,6 +51,18 @@ feature 'Users', feature: true, js: true do expect(current_path).to eq user_path(user) expect(page).to have_text(user.name) end + + scenario '/u/user1/groups redirects to user groups page' do + visit '/u/user1/groups' + + expect(current_path).to eq user_groups_path(user) + end + + scenario '/u/user1/projects redirects to user projects page' do + visit '/u/user1/projects' + + expect(current_path).to eq user_projects_path(user) + end end feature 'username validation' do diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb index 488dc1a63b0..c18a2d55e43 100644 --- a/spec/routing/routing_spec.rb +++ b/spec/routing/routing_spec.rb @@ -15,27 +15,27 @@ describe UsersController, "routing" do end it "to #groups" do - expect(get("/u/User/groups")).to route_to('users#groups', username: 'User') + expect(get("/users/User/groups")).to route_to('users#groups', username: 'User') end it "to #projects" do - expect(get("/u/User/projects")).to route_to('users#projects', username: 'User') + expect(get("/users/User/projects")).to route_to('users#projects', username: 'User') end it "to #contributed" do - expect(get("/u/User/contributed")).to route_to('users#contributed', username: 'User') + expect(get("/users/User/contributed")).to route_to('users#contributed', username: 'User') end it "to #snippets" do - expect(get("/u/User/snippets")).to route_to('users#snippets', username: 'User') + expect(get("/users/User/snippets")).to route_to('users#snippets', username: 'User') end it "to #calendar" do - expect(get("/u/User/calendar")).to route_to('users#calendar', username: 'User') + expect(get("/users/User/calendar")).to route_to('users#calendar', username: 'User') end it "to #calendar_activities" do - expect(get("/u/User/calendar_activities")).to route_to('users#calendar_activities', username: 'User') + expect(get("/users/User/calendar_activities")).to route_to('users#calendar_activities', username: 'User') end end |