This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running: cucumber /Users/seivan/Downloads/bmabey-cucumber_rails-6c6a4fc3f52ab67c86733a5721886bb3f1891642/features/errors.feature --format=html | |
Feature: See errors | |
In order to fix errors | |
Developers should see Rails errors bubble up | |
Scenario: Visit nonexistent page | |
When I visit a nonexistent page | |
Then the Ruby error message should match 'No route matches "/does/not/exist"' | |
undefined method `should' for "undefined method `visit' for #<Object:0x1259aa8>":String (NoMethodError) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if !${1:list}.blank? -%> | |
<% for ${2:item} in ${1} -%> | |
$4<%= ${2}.$3 -%> | |
<% end -%> | |
<% else -%> | |
$5 | |
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%#= link_to "#{years.created_at.strftime("%Y")}", :action => "archive_months", :years => years.created_at.strftime("%Y")%> | |
<%= link_to "#{years.created_at.strftime("%Y")}", archive_months_blogpost_path(years.#{years.created_at.strftime("%Y")}) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Portfolio.blogposts.models import Post, File | |
from django.contrib import admin | |
class FileInLine(admin.StackedInLine): | |
model = File | |
extra = 3 | |
class PostAdmin(admin.ModelAdmin): | |
fieldsets = [ | |
('Text', {'fields' : ['subject', 'content']}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>todo</h2> | |
{% for item in items %} | |
<p>{{item.name}} - Created at:{{item.created_at}}</p> | |
<p>{{item.description|linebreaksbr}}</p> | |
<p>{{item.updated_at}}</p> | |
{% url views.detail item.name %} | |
<hr /> | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>todo</h2> | |
{% for item in items %} | |
<p>{{item.name}} - Created at:{{item.created_at}}</p> | |
<p>{{item.description|linebreaksbr}}</p> | |
<p>{{item.updated_at}}</p> | |
<a href="{% url stuff item.name %}">TEST</a> | |
<hr /> | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def detail(request, todo_name): | |
item = get_object_or_404(Todo, name=todo_name) | |
return render_to_response('detail_list.html', {'item' : item}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save(self): | |
if not self.id: | |
self.created = datetime.datetime.now() | |
self.updated = datetime.datetime.now() | |
self.permalink = slugify(self.name) | |
super(Todo, self).save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save(self): | |
if not self.id: | |
self.created = datetime.datetime.now() | |
self.updated = datetime.datetime.now() | |
self.permalink = slugify(self.name) | |
super(Todo, self).save() |