Sha256: 4a502a42a533861df7fa1a8e339dbb00bae273594722a40a3a6f9c331d66ab8b

Contents?: true

Size: 1.21 KB

Versions: 44

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'

describe CoalescingPanda::LtiController, :type => :controller do
  routes { CoalescingPanda::Engine.routes }

  describe '#lti_config' do

    it 'generates lti xml config'do
      get(:lti_config)
      xml = Nokogiri::XML(response.body)
      xml.at_xpath('//blti:title').text.should == 'LTI Tool'
      xml.at_xpath('//lticm:property[@name="domain"]').text.should_not == nil
      xml.at_xpath('//lticm:property[@name="privacy_level"]').text.should == 'public'
    end

    it 'generates lti nav config' do
      pending('cannot figure out why url: "test" is not working.')
      CoalescingPanda.stage_navigation(:account, {
        url: 'launch',
        text: 'My Title',
        enabled: false
      })
      CoalescingPanda.register_navigation(:account)
      CoalescingPanda.propagate_lti_navigation
      get(:lti_config)
      xml = Nokogiri::XML(response.body)
      account_nav = xml.at_xpath('//lticm:options[@name="account_navigation"]')
      account_nav.at_xpath('lticm:property[@name="enabled"]').text.should == 'false'
      account_nav.at_xpath('lticm:property[@name="text"]').text.should == 'My Title'
      account_nav.at_xpath('lticm:property[@name="url"]').text.should == 'foo'
    end

  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
coalescing_panda-4.0.11 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.0.10 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.0.9 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.0.8 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.0.7 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.3.2 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.3.0 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.2.2 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.2.1 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.2.0 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.26 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.25 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.24 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.23 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.22 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.21 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.20 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.19 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.18 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-4.1.17 spec/controllers/coalescing_panda/lti_controller_spec.rb