-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
4 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 @@ | ||
[{"id":"21","name":"rh-mediawiki-apb","description":"Mediawiki apb implementation"},{"id":"153","name":"s2i-fuse71-karaf-camel-rest-sql","description":"Camel example using Rest DSL with SQL Database in Karaf container. This example demonstrates how to use SQL via JDBC along with Camel's REST DSL to expose a RESTful API. The OpenShift MySQL container image should already be installed and running on your OpenShift installation, one simple way to run a MySQL service is following the documentation of the OpenShift MySQL container image related to the mysql-ephemeral template.."}] |
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,27 @@ | ||
module MockApi | ||
module ServiceCatalog | ||
class ServiceOffering | ||
def initialize(options) | ||
@mock = JSON.parse(File.read("#{Rails.root}/spec/support/service_catalog/service_offering.json")) | ||
self | ||
end | ||
|
||
def self.find(id) | ||
new({}).show(id) | ||
end | ||
|
||
def show(id) | ||
vcr = instance_variable_get(:@mock) | ||
resp = vcr.select { |x| x['id'] == id } | ||
raise ActiveRecord::RecordNotFound if resp.empty? | ||
@normalized = resp.first | ||
self | ||
end | ||
|
||
def to_normalized_params() | ||
@normalized["service_offering_ref"] = @normalized["id"] | ||
@normalized | ||
end | ||
end | ||
end | ||
end |