Sha256: c8a3d6bea69bc5a181d1395cc47e0f0bcf55409e991b8c863ad8d6a63a0723b5

Contents?: true

Size: 1.09 KB

Versions: 11

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe Rearview::UrlHelper do
  subject { Rearview::UrlHelper }
  context ".job_url" do
    context "job in dashboard with parent" do
      it "generates the correct url" do
        dashboard_child = FactoryGirl.create(:dashboard,parent: FactoryGirl.create(:dashboard))
        job = FactoryGirl.create(:job,app_id: dashboard_child.id)
        expected_url = "http://%s:%s/rearview/#dash/%s/expand/%s" % [
          Rearview.config.default_url_options[:host],
          Rearview.config.default_url_options[:port],
          dashboard_child.parent_id,
          job.id
        ]
        expect(subject.job_url(job)).to eq(expected_url)
      end
    end
    context "job in dashboard without parent" do
      it "generates the correct url" do
        job = FactoryGirl.create(:job)
        expected_url = "http://%s:%s/rearview/#dash/%s/expand/%s" % [
          Rearview.config.default_url_options[:host],
          Rearview.config.default_url_options[:port],
          job.app_id,
          job.id
        ]
        expect(subject.job_url(job)).to eq(expected_url)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rearview-1.2.3-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.2.2.rc.2-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.2.2.rc.1-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.2.1-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.2.0-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.1.2-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.1.1-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.1.0-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.0.3.rc.4-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.0.3.rc.3-jruby spec/lib/rearview/url_helper_spec.rb
rearview-1.0.3.rc.2-jruby spec/lib/rearview/url_helper_spec.rb