Sha256: 59a38fd417da13f54a1ffa79badadb38bed26544e8a0f1ead37ce36f4349a17a
Contents?: true
Size: 759 Bytes
Versions: 12
Compression:
Stored size: 759 Bytes
Contents
require 'tmpdir' require 'pathname' require File.expand_path('../../lib/rabl', __FILE__) class TestHelperMethods include Rabl::Helpers end context "Rabl::Helpers" do setup do @helper_class = TestHelperMethods.new @user = User.new end context "for data_name method" do asserts "returns nil if no data" do @helper_class.data_name(nil) end.equals(nil) asserts "returns alias if hash with symbol is passed" do @helper_class.data_name(@user => :user) end.equals(:user) asserts "returns name of first object of a collection" do @helper_class.data_name([@user, @user]) end.equals('users') asserts "returns name of an object" do @helper_class.data_name(@user) end.equals('user') end end
Version data entries
12 entries across 12 versions & 1 rubygems