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