Sha256: 225406af2f14b7eb792f5249b7e0e1ebcc639d30ec77d502ef83513e9aeb5740
Contents?: true
Size: 1.45 KB
Versions: 30
Compression:
Stored size: 1.45 KB
Contents
require 'spec_helper' describe CoalescingPanda::LtiController do routes { CoalescingPanda::Engine.routes } describe '#lti_config' do it 'generates lti xml config'do controller.main_app.stub(:test_action_url) {'foo'} 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 controller.main_app.stub(:test_action_url) {'foo'} 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 controller.main_app.stub(:test_action_url) {'foo'} options = controller.send(:ext_params, {url:'test_action'}) options[:url].should == 'foo' end end
Version data entries
30 entries across 30 versions & 1 rubygems