Sha256: ca23136c358848a6880eba35f7e533e9d0c8755e7e2401043c7d3903c97c858b
Contents?: true
Size: 631 Bytes
Versions: 11
Compression:
Stored size: 631 Bytes
Contents
require 'rails_helper' RSpec.describe Spree::Preferences::Configuration, type: :model do before :all do class AppConfig < Spree::Preferences::Configuration preference :color, :string, default: :blue end @config = AppConfig.new end it "has named methods to access preferences" do @config.color = 'orange' expect(@config.color).to eq 'orange' end it "uses [ ] to access preferences" do @config[:color] = 'red' expect(@config[:color]).to eq 'red' end it "uses set/get to access preferences" do @config.set(color: 'green') expect(@config.get(:color)).to eq 'green' end end
Version data entries
11 entries across 11 versions & 1 rubygems