Permalink
Browse files

Added serializer for Project zen-9

  • Loading branch information...
1 parent 164408f commit 8ad121cbfb8486668175048cc8d5b1c05f7e8f9f @amirci committed Apr 9, 2012
Showing with 6 additions and 5 deletions.
  1. +3 −0 app/serializers/project_serializer.rb
  2. +3 −5 spec/controllers/projects_controller_spec.rb
@@ -0,0 +1,3 @@
+class ProjectSerializer < ActiveModel::Serializer
+ attributes :name, :description
+end
@@ -7,10 +7,8 @@
:name => "project_#{i}",
:description => "description_#{i}") } }
-# let(:exceptions) { [:project_id, :created_at, :updated_at] }
- let(:exceptions) { [] }
+ let(:exceptions) { [:project_id, :created_at, :updated_at] }
-
describe '#index' do
let(:json) { {projects: projects}.to_json(except: exceptions) }
@@ -24,8 +22,8 @@
end
describe '#create' do
- let(:attrib) {{name: 'Super project', description: 'Really super!'}}
- let(:new_project) {stub_model(Project, attrib)}
+ let(:attrib) {{name: 'Super project', description: 'Really super!'}}
+ let(:new_project) {stub_model(Project, attrib)}
let(:create_attrib) {{"name"=>"Super project", "description"=>"Really super!"}}
# before { Project.stub(:new).and_return(new_project) }

0 comments on commit 8ad121c

Please sign in to comment.