Sha256: 0354f9dcb64d563a88a8130d776fa69cc7fda31f99a986527b6520a32f57ec70

Contents?: true

Size: 1.3 KB

Versions: 21

Compression:

Stored size: 1.3 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
      CoalescingPanda.stage_navigation(:account, {
        url: 'test_action',
        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

  it 'get the url, from the action string' do
    options = controller.send(:ext_params, {url:'test_action'})
    options[:url].should == 'foo'
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
coalescing_panda-3.2.3 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.2.2 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.2.1 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.2.0 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.14 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.13 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.12 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.11 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.10 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.9 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.8 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.7 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.6 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.5 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.4 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.3 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.2 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.1 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.1.0 spec/controllers/coalescing_panda/lti_controller_spec.rb
coalescing_panda-3.0.1 spec/controllers/coalescing_panda/lti_controller_spec.rb