Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vistahigherlearning / common_cartridge   ruby

Repository URL to install this package:

Version: 1.0.1 

/ spec / elements / resources / web_link_spec.rb

require 'spec_helper'

module CommonCartridge
  module Elements
    module Resources
      describe WebLink do
        before(:all) do
          manifest = CommonCartridge.parse_from_zip('canvas_small_1.1.imscc').manifest
          @resource = manifest.resources.detect { |r| r.identifier =~ /I_00005_R/ }
        end

        it "is parsed correctly" do
          expect(@resource.files.first.content).to be_kind_of(CommonCartridge::Elements::Resources::WebLink)
        end

        it "has a title" do
          expect(@resource.files.first.content.title).to eq("Wikipedia - Your Mom")
        end

        it "has a href" do
          expect(@resource.files.first.content.href).to eq("http://en.wikipedia.org/wiki/Maternal_insult")
        end

        it "has a target" do
          expect(@resource.files.first.content.target).to eq("_self")
        end
      end
    end
  end
end