Skip to content

Instantly share code, notes, and snippets.

$ rake routes
locations (/:locale)/locations(.:format) locations#index
new_locations (/:locale)/locations/new(.:format) locations#new
locations POST (/:locale)/locations(.:format) locations#create
root /(:locale)(.:format) locations#index
$ cucumber --profile wip
Using the wip profile...
Feature: Manage locations
In order to manage locations
As a user
I want to create and edit my locations.
@wip
Scenario: Create a new location # features/manage_locations.feature:19
Given I am on new location page # features/step_definitions/location_steps.rb:22
match 'locations/' => 'locations#index', :as => :locations, :via => [:get]
locations GET (/:locale)/locations(.:format) locations#index
new_locations (/:locale)/locations/new(.:format) locations#new
locations POST (/:locale)/locations(.:format) locations#create
root /(:locale)(.:format) locations#index
$ cucumber --profile wip
Using the wip profile...
Feature: Manage locations
In order to manage locations
As a user
I want to create and edit my locations.
@wip
Scenario: Create a new location # features/manage_locations.feature:19
Given I am on new location page # features/step_definitions/location_steps.rb:22
# POST /locations
# POST /locations.json
def create
@location = Location.new(params[:location])
respond_to do |format|
if @location.save
format.html { redirect_to @location, notice: 'Location was successfully created.' }
format.json { render json: @location, status: :created, location: @location }
else
$ cucumber --profile wip
Using the wip profile...
Feature: Manage locations
In order to manage locations
As a user
I want to create and edit my locations.
@wip
Scenario: Create a new location # features/manage_locations.feature:19
Given I am on new location page # features/step_definitions/location_steps.rb:22
match "locations/show/(:id)" => 'locations#show', :as => :location
$ cucumber --profile wip
Using the wip profile...
Feature: Manage locations
In order to manage locations
As a user
I want to create and edit my locations.
@wip
Scenario: Create a new location # features/manage_locations.feature:19
Given I am on new location page # features/step_definitions/location_steps.rb:22
# GET /locations/1
# GET /locations/1.json
def show
@location = Location.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @location }
end
end