forked from ManageIQ/depot.manageiq.org
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from sensu/fix-routes-for-versions-with-periods
Fix routing for versions containing periods
- Loading branch information
Showing
2 changed files
with
61 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
require 'spec_helper' | ||
|
||
describe 'extension version routes' do | ||
context 'to show a user' do | ||
|
||
it 'routes /assets/sensu/sensu-pagerduty-handler/versions/master to extension_version#show' do | ||
expect(get: "/assets/sensu/sensu-pagerduty-handler/versions/master").to route_to( | ||
:controller => "extension_versions", | ||
:action => "show", | ||
:username => "sensu", | ||
:extension_id => "sensu-pagerduty-handler", | ||
:version => "master" | ||
) | ||
end | ||
|
||
it 'routes /assets/sensu/sensu-pagerduty-handler/versions/1.0.0 to extension_version#show' do | ||
expect(get: "/assets/sensu/sensu-pagerduty-handler/versions/1.0.0").to route_to( | ||
:controller => "extension_versions", | ||
:action => "show", | ||
:username => "sensu", | ||
:extension_id => "sensu-pagerduty-handler", | ||
:version => "1.0.0" | ||
) | ||
end | ||
|
||
it 'routes /assets/sensu/sensu-pagerduty-handler/versions/1.0.0-alpha to extension_version#show' do | ||
expect(get: "/assets/sensu/sensu-pagerduty-handler/versions/1.0.0-alpha").to route_to( | ||
:controller => "extension_versions", | ||
:action => "show", | ||
:username => "sensu", | ||
:extension_id => "sensu-pagerduty-handler", | ||
:version => "1.0.0-alpha" | ||
) | ||
end | ||
|
||
it 'routes /assets/sensu/sensu-pagerduty-handler/versions//1.0.0-alpha+1241 to extension_version#show' do | ||
expect(get: "/assets/sensu/sensu-pagerduty-handler/versions/1.0.0-alpha+1241").to route_to( | ||
:controller => "extension_versions", | ||
:action => "show", | ||
:username => "sensu", | ||
:extension_id => "sensu-pagerduty-handler", | ||
:version => "1.0.0-alpha+1241" | ||
) | ||
end | ||
|
||
end | ||
end |