Sha256: 661fa8b5f95e2fcff0e7ac1e44121efa6cc08a1bfda5ca430eb3ddeef47449ed

Contents?: true

Size: 543 Bytes

Versions: 3

Compression:

Stored size: 543 Bytes

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

describe Shortener::ShortenedUrlsController do
  let(:short_url) { Shortener::ShortenedUrl.generate("www.doorkeeperhq.com") }

  describe "GET show with good code" do
    it "redirects to actual url" do
      get :show, :id => short_url.unique_key
      response.should redirect_to("http://www.doorkeeperhq.com/")
    end
  end
  describe "GET show with wrong code" do
    it "redirects to actual url" do
      get :show, :id => "testing"
      response.should redirect_to("/")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shortener-0.1.2 spec/controllers/shortened_urls_controller_spec.rb
shortener-0.1.1 spec/controllers/shortened_urls_controller_spec.rb
shortener-0.1.0 spec/controllers/shortened_urls_controller_spec.rb