Skip to content

Commit

Permalink
Merge pull request hotsh#537 from clnclarinet/yaks
Browse files Browse the repository at this point in the history
Yaks
  • Loading branch information
carols10cents committed May 2, 2012
2 parents 468e962 + b15cc69 commit bba0d70
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 175 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ group :development, :test do
gem "simplecov", "~> 0.4.0", :require => false
gem "launchy"
gem "minitest", "~> 2.12.1"
gem "quiet_assets"
end

group :test do
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ GEM
mail (> 2.0)
pygmentize (0.0.3)
pyu-ruby-sasl (0.0.3.3)
quiet_assets (1.0.0)
rails (~> 3.1)
rack (1.3.2)
rack-cache (1.0.3)
rack (>= 0.4)
Expand Down Expand Up @@ -333,6 +335,7 @@ DEPENDENCIES
osub (~> 0.0.6)
pony
pygmentize
quiet_assets
rails (= 3.1.0)
rdiscount
redfinger
Expand Down
15 changes: 0 additions & 15 deletions app/controllers/searches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,4 @@ def show
set_pagination_buttons(@updates)
end
end

# DERP, this duplication sucks, and this code kinda sucks
# anyway. Let's see if we can't remove it in the future.
def set_pagination
set_params_page
@updates = @updates.paginate(:page => params[:page], :per_page => params[:per_page], :order => :created_at.desc)
set_pagination_buttons(@updates)
end

# Render correct haml depending on request type
def render_index(updates)
@updates = updates
set_pagination
render :index, :layout => show_layout?
end
end
2 changes: 0 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
match "contact" => "static#contact"
match "open_source" => "static#open_source"
match "help" => "static#help"
# static for remote follows
match "/follow", :to => "static#follow"

# External Auth
match '/auth/:provider/callback', :to => 'auth#auth'
Expand Down
46 changes: 8 additions & 38 deletions test/acceptance/update_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
log_in_as_some_user

update_text = "Testing, testing"
params = {
:text => update_text
}

VCR.use_cassette('publish_update') do
visit "/"
Expand All @@ -47,43 +44,16 @@
assert_match page.body, /#{update_text}/
end

it "makes a short update" do
log_in_as_some_user
["/updates", "/replies", "/"].each do |url|
it "stays on the #{url} page after making an update there" do
log_in_as_some_user

update_text = "Q"
params = {
:text => update_text
}
visit url
fill_in "text", :with => "Buy a test string. Your name in this string for only 1 Euro/character"
VCR.use_cassette('publish_to_hub') { click_button "Share" }

VCR.use_cassette('publish_short_update') do
visit "/"
fill_in 'update-textarea', :with => update_text
click_button :'update-button'
assert_match url, page.current_url, "Ended up on #{page.current_url}, expected to be on #{url}"
end

refute_match page.body, /Your status is too short!/
end

it "stays on the same page after updating" do
log_in_as_some_user

visit "/updates"
fill_in "text", :with => "Teststring fuer die Ewigkeit ohne UTF-8 Charakter"
VCR.use_cassette('publish_to_hub') {click_button "Share"}

assert_match "/updates", page.current_url

visit "/replies"
fill_in "text", :with => "Bratwurst mit Pommes rot-weiss"
VCR.use_cassette('publish_to_hub') {click_button "Share"}

assert_match "/replies", page.current_url

visit "/"
fill_in "text", :with => "Buy a test string. Your name in this string for only 1 Euro/character"
VCR.use_cassette('publish_to_hub') {click_button "Share"}

assert_match "/", page.current_url
end

it "shows one update" do
Expand Down Expand Up @@ -273,7 +243,7 @@

it "has a status of someone i'm following in my timeline" do
u2 = Fabricate(:user)
update = Fabricate(:update, :author => @u.author)
update = Fabricate(:update, :author => u2.author)
u2.feed.updates << update
@u.follow! u2.feed

Expand Down
120 changes: 0 additions & 120 deletions test/data/vcr_cassettes/publish_short_update.yml

This file was deleted.

0 comments on commit bba0d70

Please sign in to comment.