Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: ruby
rvm:
- 1.9.3
- 2.2.3
before_install:
- "export DISPLAY=:99.0"
- "bundle install"
- "bundle exec rake db:migrate RAILS_ENV=test"
- "bundle exec rspec spec"
env:
global:
- DISPLAY=:99.0
- DISPLAY=:99.0
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ group :production do
end

group :test do
gem 'test-unit'
gem 'shoulda-matchers'
end

Expand Down
113 changes: 63 additions & 50 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ GEM
activesupport (3.2.21)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
addressable (2.4.0)
arel (3.0.3)
builder (3.0.4)
capybara (2.1.0)
capybara (2.7.1)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
Expand All @@ -40,23 +42,24 @@ GEM
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.6.3)
coveralls (0.6.9)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
daemons (1.1.9)
diff-lcs (1.2.4)
coffee-script-source (1.10.0)
coveralls (0.8.13)
json (~> 1.8)
simplecov (~> 0.11.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6.0)
daemons (1.2.3)
diff-lcs (1.2.5)
docile (1.1.5)
dynamic_form (1.1.4)
erubis (2.7.0)
eventmachine (1.0.8)
execjs (2.0.1)
factory_girl (4.2.0)
eventmachine (1.2.0.1)
execjs (2.6.0)
factory_girl (4.7.0)
activesupport (>= 3.0.0)
hike (1.2.3)
i18n (0.7.0)
Expand All @@ -65,19 +68,19 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
mail (2.4.4)
i18n (>= 0.4.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
mini_portile (0.5.1)
multi_json (1.11.0)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
mini_portile2 (2.0.0)
multi_json (1.12.0)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
pg (0.15.1)
polyglot (0.3.5)
rack (1.4.5)
rack-cache (1.2)
power_assert (0.2.6)
rack (1.4.7)
rack-cache (1.6.1)
rack (>= 0.4)
rack-ssl (1.3.4)
rack
Expand All @@ -98,57 +101,63 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.4.2)
rake (11.1.2)
rdoc (3.12.2)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec-core (2.14.5)
rspec-expectations (2.14.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.3)
rspec-rails (2.14.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
sass (3.2.10)
rspec-core (3.4.4)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-rails (3.4.2)
actionpack (>= 3.0, < 4.3)
activesupport (>= 3.0, < 4.3)
railties (>= 3.0, < 4.3)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
sass (3.4.22)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
scoped_search (2.6.0)
scoped_search (2.6.5)
activerecord (>= 2.1.0)
shoulda-matchers (2.3.0)
shoulda-matchers (2.8.0)
activesupport (>= 3.0.0)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sprockets (2.2.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.11)
term-ansicolor (1.2.2)
tins (~> 0.8)
term-ansicolor (1.3.2)
tins (~> 1.0)
test-unit (3.1.5)
power_assert
thin (1.5.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.19.1)
tilt (1.4.1)
tins (0.9.0)
tins (1.6.0)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.43)
uglifier (2.2.1)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
tzinfo (0.3.49)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand All @@ -170,5 +179,9 @@ DEPENDENCIES
scoped_search (~> 2.6.0)
shoulda-matchers
sqlite3
test-unit
thin (~> 1.5.0)
uglifier (>= 1.3.0)

BUNDLED WITH
1.11.2
1 change: 1 addition & 0 deletions app/controllers/jobs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def new
end

def edit
puts params.inspect
@job = find_job_with_key
unless @job.present?
redirect_not_found
Expand Down
13 changes: 12 additions & 1 deletion app/views/jobs/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,15 @@
<p class='form_control'>
<%= form.submit "Update Job >>" %>
</p>
<% end %>
<% end %>

<%= form_for(@job, method: "delete", html: {:onsubmit => "return confirm('Are you sure?');" }) do |form| %>
<%= hidden_field_tag :key, @job.key %>

<p class='form_control'>
<%= form.submit "Delete Job" %>
</p>


<% end %>

2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
timeout: 5000
1 change: 0 additions & 1 deletion spec/controllers/jobs_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe JobsController do
integrate_views

describe "the index action" do
before do
Expand Down
24 changes: 24 additions & 0 deletions spec/features/job_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'spec_helper'

describe 'viewing jobs' do
before do
visit '/jobs'
end

it 'should have a text' do
page.should have_text('The latest Ruby jobs in Ireland')
end
end


describe 'editing a job' do
before do
job = create :job
visit "/jobs/#{job.id}/edit?key=#{job.key}"
end

it 'should have a text' do
page.should have_selector("input[type=submit][value='Delete Job']")
end

end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
config.use_transactional_fixtures = true
config.infer_base_class_for_anonymous_controllers = false
config.order = "random"
config.color_enabled = true
#config.color_enabled = true
config.formatter = 'documentation'

config.include FactoryGirl::Syntax::Methods
Expand Down