Skip to content

Commit

Permalink
GH #22: changed the acceptance tests to work in production environment
Browse files Browse the repository at this point in the history
on an EC2 instance
  • Loading branch information
Larry Karnowski and Lake Denman committed Apr 10, 2012
1 parent fb21681 commit b24bd94
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 3 additions & 1 deletion lib/generators/fixtures/fixtures_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def create_views
%h1 WELCOME HOME
STR
create_file "app/views/relevance_rails/db.html.haml", <<-STR
%h1.database= ActiveRecord::Base.connection.current_database
= conn = ActiveRecord::Base.connection
= results = conn.execute("select 4200+42 as advanced_math")
%h1.advanced_math= results.first["advanced_math"]
STR
end

Expand Down
18 changes: 9 additions & 9 deletions spec/acceptance_spec.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
require 'spec_helper'

describe 'App is alive', :js => true, :acceptance => true do
it 'verifies coffeescript served up as js' do
visit '/assets/relevance_rails.js'
page.should have_content "console.log('Hello from Relevance, Inc!');"
end

it "verifies haml is served up" do
visit '/relevance_rails'
page.should have_content 'WELCOME HOME'
end

it 'verifies coffeescript served up as js' do
visit '/assets/application.js'
page.should have_content 'console.log("Hello from Relevance, Inc!")'
end

it "verifies scss is served up as css" do
visit '/assets/relevance_rails.css'
page.should have_content "background-color: blue;"
visit '/assets/application.css'
page.should have_content "background-color:blue"
end

it "verifies a working database connection" do
visit '/relevance_rails/db'
within ('h1.database') do
page.should have_content '_development'
within ('h1.advanced_math') do
page.should have_content '4242'
end
end
end
3 changes: 1 addition & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ def should_abort_with(msg)

Capybara.current_driver = :selenium
Capybara.run_server = false
#Capybara.app_host = 'http://' + (ENV["ACCEPTANCE_HOST"] || 'localhost:3000')
Capybara.app_host = ENV["ACCEPTANCE_HOST"] || 'http://localhost:3000'
Capybara.app_host = 'http://' + (ENV["ACCEPTANCE_HOST"] || 'localhost:3000')

1 comment on commit b24bd94

@aredington
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to the fixtures_generator in this commit have caused failures when Muness took a test drive in MySQL. Instead of returning a result set, it returned a single result with no column names.

Please sign in to comment.