Permalink
Browse files

records.feature passing, added Procfile for foreman

  • Loading branch information...
1 parent 32eb850 commit a45620ea01de4fa314df22e45ff3a96cc2b43d75 Antono Vasiljev committed Apr 1, 2012
View
@@ -23,8 +23,6 @@ gem 'progress_bar'
# Gems used only for assets and not required
-# in productionvironments by default.
-# http://stackoverflow.com/questions/7756293/undefined-method-sass-for-railsapplicationconfiguration-on-heroku
gem 'sass-rails', '~> 3.2.3'
gem 'jquery-rails'
gem 'backbone-rails'
View
@@ -0,0 +1,2 @@
+web: rails server
+solr: bundle exec rake sunspot:solr:run
@@ -6,4 +6,6 @@ Feature: Records
@javascript
Scenario: browsing records
Given I signed in
- And I'm on the "/records" page
+ And there are 3 records in db
+ When I visit "/records" page
+ Then I should see some records
@@ -4,4 +4,4 @@ Feature: Registration
In order to get some fun
Scenario: via twitter
- Given I'm on the '/' page
+ Given I'm on the / page
@@ -10,6 +10,7 @@
describe "GET landing" do
it "should assign records for feed" do
+ Factory(:record)
get :landing
assigns(:records).should_not be_blank
end
View
Binary file not shown.
View
@@ -1,9 +1,10 @@
require 'rubygems'
require 'spork'
-require 'turnip'
require 'capybara/rails'
require 'capybara/rspec'
+require 'turnip'
require 'turnip/capybara'
+require 'database_cleaner'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
@@ -45,12 +46,14 @@
Sunspot.session = SunspotMatchers::SunspotSessionSpy.new(Sunspot.session)
end
+ config.after :each do
+ DatabaseCleaner.clean
+ end
+
#
# Turnip
#
Turnip::Config.step_dirs = Rails.root.join('spec', 'steps')
- Turnip::StepLoader.load_steps
-
#
# Datablase cleaner
#
@@ -70,4 +73,6 @@
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+ Turnip::StepLoader.steps_loaded = false
+ Turnip::StepLoader.load_steps
end
@@ -1,12 +1,17 @@
-step "I signed in" do |page|
+step "I signed in" do
visit "/auth/developer"
fill_in 'Name', with: 'antono'
fill_in 'Email', with: 'self@antono.info'
click_button 'Sign In'
+ page.should have_content 'Signed in successfully'
page.should have_content 'Profile'
click_button 'Save'
end
-step "I'm on the :page page" do |page|
- visit page
+step "I'm on the :path page" do |path|
+ visit path
+end
+
+step "I visit :path page" do |path|
+ visit path
end
@@ -0,0 +1,23 @@
+step "I should see :some records" do |some|
+ case some
+ when 'some'
+ page.find('.records .record').should_not raise_error Capybara::ElementNotFound
+ when '0'
+ page.find('.records .record').should raise_error Capybara::ElementNotFound
+ else
+ page.find('.records .record').should_not raise_error Capybara::ElementNotFound
+ page.find('.records .record').count.should == Integer(some)
+ end
+end
+
+step "there is/are :num record(s) in db" do |num|
+ num = Integer(num)
+ case num
+ when 0
+ Record.destroy_all
+ else
+ (num - Record.count).times do
+ FactoryGirl.create(:record)
+ end
+ end
+end

0 comments on commit a45620e

Please sign in to comment.