Permalink
Browse files

Basic implementation of a program description field

  • Loading branch information...
1 parent 68997eb commit 8423d75f615f7513ca187643659380e65ff997f5 Matt Gauger committed with Jan 16, 2012
@@ -4,6 +4,7 @@ class Program
key :author_username, String
key :slug, String
key :title, String
+ key :description, String
key :source_code, String
key :featured, Boolean
timestamps!
@@ -27,6 +27,7 @@
%li
.title= program_link program
.author= author_link program.author_username, program
+ .description= program.description
- if @user
%ul.inline-menu.bottom-nav
@@ -13,4 +13,10 @@ Feature: Access Programs
Scenario: View another user's programs
Given a user has uploaded a program
- Then I should be able to view their programs
+ Then I should be able to view their programs
+
+ Scenario: View a program with a description
+ Given a user has uploaded a program
+ And they have given their program a description
+ Then I should be able to view their programs
+ And I should see the description on their program
@@ -30,6 +30,13 @@ def upload_program(user)
upload_program(@user)
end
+Given /^they have given their program a description$/ do
+ @program = Program.last
+ @program.description = "A really cool program!"
+ @program.save
+end
+
+
def visit_user_programs_page
visit user_path(@user)
within ".about-user" do
@@ -44,4 +51,8 @@ def visit_user_programs_page
Then /^I should be able to view their programs$/ do
visit_user_programs_page
-end
+end
+
+Then /^I should see the description on their program$/ do
+ page.should have_content("A really cool program!")
+end
@@ -1,7 +1,8 @@
require 'spec_helper'
describe Program do
- let(:prog) { Program.create(author_username: 'tester', title: 'test title')}
+ let(:prog) { Program.create(author_username: 'tester', title: 'test title')}
+
it "sets the slug" do
prog.slug.should == 'test-title'
end

0 comments on commit 8423d75

Please sign in to comment.