Sha256: 285265c8526a4097895072488ee45d2ae396e457b28bffbf6efa09a3600fd7de

Contents?: true

Size: 1.04 KB

Versions: 14

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe WoopleTheme::VideoPresenter do
  subject { WoopleTheme::VideoPresenter.new(stub_presenter) }

  describe "#liked_css" do
    it "returns nothing" do
      subject.liked_css.should be_nil
    end

    it "returns 'active' when liked" do
      subject.stub(:liked?) { true }

      subject.liked_css.should eq('active')
    end

    it "returns nil when not liked" do
      subject.stub(:liked?) { false }

      subject.liked_css.should be_nil
    end
  end

  describe "#disliked_css" do
    it "returns nothing" do
      subject.disliked_css.should be_nil
    end

    it "returns 'active' when disliked" do
      subject.stub(:liked?) { false }

      subject.disliked_css.should eq('active')
    end

    it "returns nil when liked" do
      subject.stub(:liked?) { true }

      subject.disliked_css.should be_nil
    end
  end

  private

  def stub_presenter(options = {})
    defaults = {name: nil, desktop_src: nil, mobile_src: nil, streamer: nil, liked?: nil}
    defaults.merge!(options)

    OpenStruct.new(defaults)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
woople-theme-0.6.27 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.26 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.25 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.24 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.23 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.22 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.21 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.20 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.19 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.18 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.17 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.14 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.13 spec/presenters/video_presenter_spec.rb
woople-theme-0.6.12 spec/presenters/video_presenter_spec.rb