Sha256: cde520aad286816c3c75272a0980a23ff89e0fa1ea959daa620004b75703e95f

Contents?: true

Size: 991 Bytes

Versions: 8

Compression:

Stored size: 991 Bytes

Contents

require 'spec_helper'

module Fooltip
  describe Link do
    it { should belong_to :container }
    it { should belong_to :popup }

    it { should validate_presence_of :container }
    it { should validate_presence_of :popup }
    it { should validate_presence_of :x }
    it { should validate_presence_of :y }
    it { should validate_presence_of :placement }
    it { should validate_presence_of :trigger }

    context ".placment_string" do
      { 1 => 'top', 2 => 'right', 3 => 'bottom', 4 => 'left' }.each do |key, value|
        it "should return '#{value}' for #{key}" do
          subject.placement = key
          subject.placement_string.should == value
        end
      end
    end

    context ".trigger_string" do
      { 1 => 'click', 2 => 'hover', 3 => 'focus', 4 => 'manual' }.each do |key, value|
        it "should return '#{value}' for #{key}" do
          subject.trigger = key
          subject.trigger_string.should == value
        end
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fooltip-0.0.13 spec/models/fooltip/link_spec.rb
fooltip-0.0.12 spec/models/fooltip/link_spec.rb
fooltip-0.0.11 spec/models/fooltip/link_spec.rb
fooltip-0.0.10 spec/models/fooltip/link_spec.rb
fooltip-0.0.9 spec/models/fooltip/link_spec.rb
fooltip-0.0.8 spec/models/fooltip/link_spec.rb
fooltip-0.0.7 spec/models/fooltip/link_spec.rb
fooltip-0.0.6 spec/models/fooltip/link_spec.rb