Sha256: 85dfab1e620d9ce2ab834522f56f2e9154e3c3306f2079c1d2c04d103b54a41a

Contents?: true

Size: 826 Bytes

Versions: 10

Compression:

Stored size: 826 Bytes

Contents

require 'spec_helper'

describe Spree::Admin::BaseHelper, :type => :helper do
  include Spree::Admin::BaseHelper

  context "#datepicker_field_value" do
    it "should return nil when date is empty" do
      date = nil
      expect(datepicker_field_value(date)).to be_nil
    end

    it "should return a formatted date when date is present" do
      date = "2013-08-14".to_time
      expect(datepicker_field_value(date)).to eq("2013/08/14")
    end
  end

  context "#plural_resource_name" do
    it "should return correct form of class" do
      resource_class = Spree::Product
      expect(plural_resource_name(resource_class)).to eq("Products")
    end
  end

  context "#order_time" do
    it "prints in a format" do
      expect(order_time(DateTime.new(2016, 5, 6, 13, 33))).to eq "2016-05-06 1:33 PM"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_backend-3.1.5 spec/helpers/admin/base_helper_spec.rb
spree_backend-3.1.4 spec/helpers/admin/base_helper_spec.rb
spree_backend-3.1.3 spec/helpers/admin/base_helper_spec.rb
spree_backend-3.1.2 spec/helpers/admin/base_helper_spec.rb
spree_backend-3.1.1 spec/helpers/admin/base_helper_spec.rb
spree_backend-3.1.0 spec/helpers/admin/base_helper_spec.rb
spree_backend-3.1.0.rc4 spec/helpers/admin/base_helper_spec.rb
spree_backend-3.1.0.rc3 spec/helpers/admin/base_helper_spec.rb
spree_backend-3.1.0.rc2 spec/helpers/admin/base_helper_spec.rb
spree_backend-3.1.0.rc1 spec/helpers/admin/base_helper_spec.rb