Sha256: 26c7ebe10b695ffae572807151864e1ee6205052fc1712c687a5e7706c3b5673
Contents?: true
Size: 1.03 KB
Versions: 16
Compression:
Stored size: 1.03 KB
Contents
class SiteHub class Cookie describe Attribute do let(:attribute_name) { 'domain' } let(:attribute_value) { 'value' } subject do described_class.new(attribute_name, attribute_value) end describe '#initialize' do it 'stores the attribute name and its value' do expect(subject.name).to eq(attribute_name.to_sym) expect(subject.value).to eq(attribute_value) end it 'sanitises the string parameter' do expect(described_class.new("#{attribute_name} \n", attribute_value).name).to eq(attribute_name.to_sym) end context 'value is nil' do subject do described_class.new(attribute_name, nil) end it 'default to empty string' do expect(subject.value).to eq('') end end end describe '#to_s' do it 'contains the attribute name and value' do expect(subject.to_s).to eq("#{attribute_name}=#{attribute_value}") end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems