Skip to content
This repository was archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Rakefile created, db upgrade and migrate commands added
Browse files Browse the repository at this point in the history
  • Loading branch information
russellyeo committed Dec 13, 2016
1 parent 07a5a53 commit e41f596
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ gem "bcrypt"
gem 'dm-postgres-adapter'
gem 'database_cleaner'
gem 'sinatra-flash'
gem 'rake'
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ GEM
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (11.3.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
Expand Down Expand Up @@ -131,6 +132,7 @@ DEPENDENCIES
data_mapper
database_cleaner
dm-postgres-adapter
rake
rspec
rspec-sinatra
selenium-webdriver
Expand Down
15 changes: 15 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require './app/vradbnb.rb'

namespace :db do
desc "auto_upgrade! - Non destructive upgrade"
task :auto_upgrade do
DataMapper.auto_upgrade!
puts "Auto-upgrade complete (no data loss)"
end

desc "auto_migrate! - Destructive upgrade"
task :auto_migrate do
DataMapper.auto_migrate!
puts "Auto-migrate complete (data was lost)"
end
end
1 change: 1 addition & 0 deletions spec/features/create_listing_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
feature "Creating a new listing" do

scenario "Owner submits a listing for their space" do
sign_up
new_listing
expect(page).to have_current_path('/listings')
expect(page).to have_content("Sunny palace")
Expand Down
9 changes: 0 additions & 9 deletions spec/features/signup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,3 @@
end

end
#
# def sign_up(email: "[email protected]", password: "12345", password_confirmation: "12345" )
# visit '/signup'
# expect(page.status_code).to eq(200)
# fill_in :email, with: email
# fill_in :password, with: password
# fill_in :password_confirmation, with: password_confirmation
# click_button "Sign Up"
# end

0 comments on commit e41f596

Please sign in to comment.