Permalink
Browse files

Remove I'm Feeling Lucky feature

  • Loading branch information...
1 parent e57ebd2 commit 86af1e7bd6907bd4c1fcaf9e5634f1c511cfb188 @veezus committed Jun 11, 2011
@@ -145,10 +145,6 @@ def redirect
end
end
- def random
- redirect_to Vurl.random.url
- end
-
def safe_url_for(vurl)
vurl.flagged_as_spam? ? spam_url(slug: vurl.slug) : vurl.url
end
View
@@ -51,10 +51,6 @@ def popular_since(period_ago, options={})
"
end
- def random
- find(:first, offset: (Vurl.count * rand).to_i)
- end
-
def tweet_most_popular_of_the_day
require 'twitter'
@@ -14,7 +14,6 @@
= f.label :url, "URL"
= f.text_field :url
= f.submit "Vurlify!", class: 'button left'
- %button.button.right.lucky_link{url: random_vurls_path} I'm Feeling Lucky
- content_for :leftcolumn do
%h2
Recent popular vurls in the last
@@ -13,10 +13,8 @@
- content_for :leftcolumn do
%h2 Other actions that might help
- %p While you're here, why don't you try the I'm Feeling Lucky feature? It will redirect you to a random vurl from the archives. You may also want to create a new vurl.
%ul
%li= link_to 'Create a new vurl', new_vurl_path
- %li= link_to "I'm Feeling Lucky", random_vurls_path, class: 'lucky_link'
%h2 All-time most popular vurls
= render partial: 'summary', collection: most_popular_vurls
@@ -21,10 +21,8 @@
Original URL:
= link_to current_vurl.url, current_vurl.url
%h2 Other actions that might help
- %p While you're here, why don't you try the I'm Feeling Lucky feature? It will redirect you to a random vurl from the archives. You may also want to create a new vurl.
%ul
%li= link_to 'Create a new vurl', new_vurl_path
- %li= link_to "I'm Feeling Lucky", random_vurls_path, class: 'lucky_link'
%h2 All-time most popular vurls
= render partial: 'summary', collection: most_popular_vurls
View
@@ -17,7 +17,6 @@
get :title
end
collection do
- get :random
get :chart_settings
get :image_screenshot
end
@@ -25,7 +25,6 @@ form#new_vurl .button.right {
width: 150px;
}
form#new_vurl .button.left {
- margin: 0 35px 0 90px;
width: 130px;
}
@@ -120,24 +120,6 @@
end
end
- describe "when redirecting to a random vurl" do
- before do
- Vurl.stub!(:random).and_return(vurl)
- end
- it "loads a random vurl" do
- Vurl.should_receive(:random).and_return(vurl)
- do_get
- end
- it "redirects to that vurl's url" do
- do_get
- response.should redirect_to(vurl.url)
- end
-
- def do_get
- get :random
- end
- end
-
describe "#safe_url_for" do
let(:vurl) { Fabricate(:vurl) }
context "when the vurl is flagged as spam" do
View
@@ -64,11 +64,6 @@
end
end
- describe ".random" do
- # Not entirely sure how to test this. Maybe stubbing count and rand and setting
- # an expectation that find is called with that offset? - Veezus
- end
-
describe ".most_popular" do
it "returns the correct number of vurls" do
5.times { Fabricate(:vurl) }

0 comments on commit 86af1e7

Please sign in to comment.