Permalink
Browse files

Add a basic server spec that clicks each top-level tab.

  • Loading branch information...
1 parent f72a252 commit 5cd643d06394af58c979c8d00cc61b59baa6c2f7 @myronmarston myronmarston committed Apr 20, 2012
Showing with 25 additions and 1 deletion.
  1. +1 −1 lib/qless/server/views/_job.erb
  2. +24 −0 spec/integration/server_spec.rb
@@ -3,7 +3,7 @@
<div class="row">
<div class="span10">
<h2>
- <a href="/jobs/<%= job.jid %>"><%= job.jid %></a> | <strong><%= job.state %> / <a href="/queues/<%= job.queue %>"><%= job.queue %></a><%= job.worker.nil? ? "/ #{job.worker}" : "" %></strong>
+ <a href="/jobs/<%= job.jid %>"><%= job.jid %></a> | <strong><%= job.state %> / <a href="/queues/<%= job.queue %>"><%= job.queue %></a><%= job.worker_name.nil? ? "/ #{job.worker_name}" : "" %></strong>
</h2>
</div>
<div class="span2">
@@ -0,0 +1,24 @@
+ENV['RACK_ENV'] = 'test'
+require 'spec_helper'
+require 'yaml'
+require 'qless/server'
+require 'capybara/rspec'
+
+module Qless
+ describe Server, :type => :request do
+ before(:all) do
+ Qless::Server.client = Qless::Client.new(redis_config)
+ Capybara.app = Qless::Server.new
+ end
+
+ it 'can visit each top-nav tab' do
+ visit '/'
+
+ links = all('ul.nav a')
+ links.should have_at_least(6).links
+ links.each do |link|
+ click_link link.text
+ end
+ end
+ end
+end

0 comments on commit 5cd643d

Please sign in to comment.