Skip to content

Instantly share code, notes, and snippets.

@guiferrpereira
Created June 3, 2013 16:12
Show Gist options
  • Save guiferrpereira/5699259 to your computer and use it in GitHub Desktop.
Save guiferrpereira/5699259 to your computer and use it in GitHub Desktop.
RABL with cucumber
# step_definitions
filepath = File.dirname(__FILE__) + "/../../templates/"
Rabl.render(false, "test.json", :view_path => filepath, :format => :json)
# test.json.rabl
object false
node(:RequestId) { "<cool>" }
node(:SenderSystem) { "<SenderSystem>" }
node(:User) { "<UserID>" }
node :Product do |m|
[
{
:ProductID => [{ :Id => "123123123", :Type => "31"}],
:BusinessOfferId => "500",
:ServiceList => [{ :Service => [{:Id => "10156", :Operation => "ACT_SRV"}] }],
:WalletList => [ {
:Wallet => [{:Type => "10156", :Operation => "CRE", :Amount => "1000"}]
}, {
:Wallet => [{:Type => "10156", :Operation => "CRE", :Amount => "1000"}]
}
],
:Card => [{ :IMSI => "514220000000001" }]
}
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment