Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

functional tests

  • Loading branch information...
commit 882459101526d9b6be4f78f00984941d059c16ea 1 parent f19ccef
Fernando Guillen authored
65 app/controllers/comments_controller.rb
View
@@ -1,41 +1,4 @@
class CommentsController < ApplicationController
- # GET /comments
- # GET /comments.xml
- def index
- @comments = Comment.find(:all)
-
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @comments }
- end
- end
-
- # GET /comments/1
- # GET /comments/1.xml
- def show
- @comment = Comment.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @comment }
- end
- end
-
- # GET /comments/new
- # GET /comments/new.xml
- def new
- @comment = Comment.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @comment }
- end
- end
-
- # GET /comments/1/edit
- def edit
- @comment = Comment.find(params[:id])
- end
# POST /comments
# POST /comments.xml
@@ -54,32 +17,4 @@ def create
end
end
- # PUT /comments/1
- # PUT /comments/1.xml
- def update
- @comment = Comment.find(params[:id])
-
- respond_to do |format|
- if @comment.update_attributes(params[:comment])
- flash[:notice] = 'Comment was successfully updated.'
- format.html { redirect_to(@comment) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /comments/1
- # DELETE /comments/1.xml
- def destroy
- @comment = Comment.find(params[:id])
- @comment.destroy
-
- respond_to do |format|
- format.html { redirect_to(comments_url) }
- format.xml { head :ok }
- end
- end
end
64 app/controllers/payments_controller.rb
View
@@ -1,41 +1,5 @@
class PaymentsController < ApplicationController
- # GET /payments
- # GET /payments.xml
- def index
- @payments = Payment.find(:all)
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @payments }
- end
- end
-
- # GET /payments/1
- # GET /payments/1.xml
- def show
- @payment = Payment.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @payment }
- end
- end
-
- # GET /payments/new
- # GET /payments/new.xml
- def new
- @payment = Payment.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @payment }
- end
- end
-
- # GET /payments/1/edit
- def edit
- @payment = Payment.find(params[:id])
- end
# POST /payments
# POST /payments.xml
@@ -54,32 +18,4 @@ def create
end
end
- # PUT /payments/1
- # PUT /payments/1.xml
- def update
- @payment = Payment.find(params[:id])
-
- respond_to do |format|
- if @payment.update_attributes(params[:payment])
- flash[:notice] = 'Payment was successfully updated.'
- format.html { redirect_to(@payment) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @payment.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /payments/1
- # DELETE /payments/1.xml
- def destroy
- @payment = Payment.find(params[:id])
- @payment.destroy
-
- respond_to do |format|
- format.html { redirect_to(payments_url) }
- format.xml { head :ok }
- end
- end
end
42 app/controllers/speakers_controller.rb
View
@@ -10,32 +10,6 @@ def index
end
end
- # GET /speakers/1
- # GET /speakers/1.xml
- def show
- @speaker = Speaker.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @speaker }
- end
- end
-
- # GET /speakers/new
- # GET /speakers/new.xml
- def new
- @speaker = Speaker.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @speaker }
- end
- end
-
- # GET /speakers/1/edit
- def edit
- @speaker = Speaker.find(params[:id])
- end
# POST /speakers
# POST /speakers.xml
@@ -54,22 +28,6 @@ def create
end
end
- # PUT /speakers/1
- # PUT /speakers/1.xml
- def update
- @speaker = Speaker.find(params[:id])
-
- respond_to do |format|
- if @speaker.update_attributes(params[:speaker])
- flash[:notice] = 'Speaker was successfully updated.'
- format.html { redirect_to(@speaker) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @speaker.errors, :status => :unprocessable_entity }
- end
- end
- end
# DELETE /speakers/1
# DELETE /speakers/1.xml
62 app/controllers/users_controller.rb
View
@@ -1,6 +1,29 @@
class UsersController < ApplicationController
- # render new.rhtml
+
+ # GET /users
+ # GET /users.xml
+ def index
+ @users = User.find(:all)
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @users }
+ end
+ end
+
+ # GET /users/1
+ # GET /users/1.xml
+ def show
+ @user = User.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @user }
+ end
+ end
+
+
def new
@user = User.new
end
@@ -37,4 +60,41 @@ def activate
redirect_back_or_default('/')
end
end
+
+ # GET /users/1/edit
+ def edit
+ @user = User.find(params[:id])
+ end
+
+ # PUT /users/1
+ # PUT /users/1.xml
+ def update
+ @user = User.find(params[:id])
+
+ puts @user.valid?
+ puts @user.errors.full_messages
+
+ respond_to do |format|
+ if @user.update_attributes(params[:user])
+ flash[:notice] = 'User was successfully updated.'
+ format.html { redirect_to(@user) }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /rooms/1
+ # DELETE /rooms/1.xml
+ def destroy
+ @user = User.find(params[:id])
+ @user.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(users_url) }
+ format.xml { head :ok }
+ end
+ end
end
49 app/controllers/votes_controller.rb
View
@@ -1,41 +1,4 @@
class VotesController < ApplicationController
- # GET /votes
- # GET /votes.xml
- def index
- @votes = Vote.find(:all)
-
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @votes }
- end
- end
-
- # GET /votes/1
- # GET /votes/1.xml
- def show
- @vote = Vote.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @vote }
- end
- end
-
- # GET /votes/new
- # GET /votes/new.xml
- def new
- @vote = Vote.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @vote }
- end
- end
-
- # GET /votes/1/edit
- def edit
- @vote = Vote.find(params[:id])
- end
# POST /votes
# POST /votes.xml
@@ -70,16 +33,4 @@ def update
end
end
end
-
- # DELETE /votes/1
- # DELETE /votes/1.xml
- def destroy
- @vote = Vote.find(params[:id])
- @vote.destroy
-
- respond_to do |format|
- format.html { redirect_to(votes_url) }
- format.xml { head :ok }
- end
- end
end
2  app/models/event.rb
View
@@ -2,7 +2,7 @@ class NotDeletableEventException < Exception
end
class Event < ActiveRecord::Base
- has_many :payments
+ has_many :payments, :dependent => :destroy
validates_presence_of :name
validates_presence_of :description
19 script/convert_new_test_sintaxis_to_old_test_sintaxis.rb
View
@@ -3,16 +3,25 @@
exit
end
-File.read(ARGV[0]).each do |line|
+if not File.exists?(ARGV[0])
+ puts "Fichero no encontrado: #{ARGV[0]}"
+ exit
+end
+
+result = ""
+
+File.open(ARGV[0]).read.each do |line|
if line =~ /^\s*test ".*" do$/
- line.gsub!( /\"\sdo\s*$/, "" )
+ line.gsub!( /\"\sdo\s*/, "" )
line.gsub!( /"/, "" )
line.gsub!( /^\s*/, "" )
line.gsub!( /\s/, "_" )
line.gsub!( /^/, "def ")
- line = " " + line
+ line = " " + line + "\n"
end
- puts line
-end
+ result << line
+end
+
+File.new( ARGV[0], "w+" ).puts( result )
6 test/fixtures/rooms.yml
View
@@ -3,4 +3,8 @@
room1:
name: Room 1
- notes: Just a Room
+ notes: Just a Room
+
+room2:
+ name: Room 2
+ notes: Just a Room 2
4 test/fixtures/users.yml
View
@@ -13,9 +13,11 @@ user1:
login: user1
email: user1@email.com
crypted_password: aaa
+ role: <%= User::ROLE_USER %>
user2:
name: User 2
login: user2
email: user2@email.com
- crypted_password: aaa
+ crypted_password: aaa
+ role: <%= User::ROLE_USER %>
37 test/functional/attends_controller_test.rb
View
@@ -1,43 +1,44 @@
require File.dirname(__FILE__) + '/../test_helper'
class AttendsControllerTest < ActionController::TestCase
- test "should get index" do
+ def setup
+ @paper = papers(:paper2)
+ @user = users(:user2)
+ end
+
+ def test_should_get_index
get :index
assert_response :success
assert_not_nil assigns(:attends)
end
- test "should get new" do
+ def test_should_get_new
get :new
assert_response :success
end
- test "should create attend" do
+ def test_should_create_attend
assert_difference('Attend.count') do
- post :create, :attend => { }
+ post(
+ :create,
+ :attend => {
+ :paper_id => @paper.id,
+ :user_id => @user.id
+ }
+ )
end
assert_redirected_to attend_path(assigns(:attend))
end
- test "should show attend" do
- get :show, :id => attends(:one).id
- assert_response :success
- end
-
- test "should get edit" do
- get :edit, :id => attends(:one).id
+ def test_should_show_attend
+ get :show, :id => attends(:user1_go_paper1).id
assert_response :success
end
- test "should update attend" do
- put :update, :id => attends(:one).id, :attend => { }
- assert_redirected_to attend_path(assigns(:attend))
- end
-
- test "should destroy attend" do
+ def test_should_destroy_attend
assert_difference('Attend.count', -1) do
- delete :destroy, :id => attends(:one).id
+ delete :destroy, :id => attends(:user1_go_paper1).id
end
assert_redirected_to attends_path
46 test/functional/comments_controller_test.rb
View
@@ -1,45 +1,19 @@
require File.dirname(__FILE__) + '/../test_helper'
class CommentsControllerTest < ActionController::TestCase
- test "should get index" do
- get :index
- assert_response :success
- assert_not_nil assigns(:comments)
- end
-
- test "should get new" do
- get :new
- assert_response :success
- end
-
- test "should create comment" do
+
+ def test_should_create_comment
assert_difference('Comment.count') do
- post :create, :comment => { }
+ post(
+ :create,
+ :comment => {
+ :paper_id => papers(:paper2).id,
+ :user_id => users(:user2).id,
+ :text => 'text'
+ }
+ )
end
assert_redirected_to comment_path(assigns(:comment))
end
-
- test "should show comment" do
- get :show, :id => comments(:one).id
- assert_response :success
- end
-
- test "should get edit" do
- get :edit, :id => comments(:one).id
- assert_response :success
- end
-
- test "should update comment" do
- put :update, :id => comments(:one).id, :comment => { }
- assert_redirected_to comment_path(assigns(:comment))
- end
-
- test "should destroy comment" do
- assert_difference('Comment.count', -1) do
- delete :destroy, :id => comments(:one).id
- end
-
- assert_redirected_to comments_path
- end
end
24 test/functional/events_controller_test.rb
View
@@ -1,43 +1,43 @@
require File.dirname(__FILE__) + '/../test_helper'
class EventsControllerTest < ActionController::TestCase
- test "should get index" do
+ def test_should_get_index
get :index
assert_response :success
assert_not_nil assigns(:events)
end
- test "should get new" do
+ def test_should_get_new
get :new
assert_response :success
end
- test "should create event" do
+ def test_should_create_event
assert_difference('Event.count') do
- post :create, :event => { }
+ post :create, :event => { :name => 'name', :description => 'description', :price_cents => 1 }
end
assert_redirected_to event_path(assigns(:event))
end
- test "should show event" do
- get :show, :id => events(:one).id
+ def test_should_show_event
+ get :show, :id => events(:event1).id
assert_response :success
end
- test "should get edit" do
- get :edit, :id => events(:one).id
+ def test_should_get_edit
+ get :edit, :id => events(:event1).id
assert_response :success
end
- test "should update event" do
- put :update, :id => events(:one).id, :event => { }
+ def test_should_update_event
+ put :update, :id => events(:event1).id, :event => { :name => 'other name' }
assert_redirected_to event_path(assigns(:event))
end
- test "should destroy event" do
+ def test_should_destroy_event
assert_difference('Event.count', -1) do
- delete :destroy, :id => events(:one).id
+ delete :destroy, :id => events(:event2).id
end
assert_redirected_to events_path
32 test/functional/papers_controller_test.rb
View
@@ -1,43 +1,51 @@
require File.dirname(__FILE__) + '/../test_helper'
class PapersControllerTest < ActionController::TestCase
- test "should get index" do
+ def test_should_get_index
get :index
assert_response :success
assert_not_nil assigns(:papers)
end
- test "should get new" do
+ def test_should_get_new
get :new
assert_response :success
end
- test "should create paper" do
+ def test_should_create_paper
assert_difference('Paper.count') do
- post :create, :paper => { }
+ post(
+ :create,
+ :paper => {
+ :title => papers(:paper1).title,
+ :description => papers(:paper1).description,
+ :family => papers(:paper1).family,
+ :status => papers(:paper1).status
+ }
+ )
end
assert_redirected_to paper_path(assigns(:paper))
end
- test "should show paper" do
- get :show, :id => papers(:one).id
+ def test_should_show_paper
+ get :show, :id => papers(:paper1).id
assert_response :success
end
- test "should get edit" do
- get :edit, :id => papers(:one).id
+ def test_should_get_edit
+ get :edit, :id => papers(:paper1).id
assert_response :success
end
- test "should update paper" do
- put :update, :id => papers(:one).id, :paper => { }
+ def test_should_update_paper
+ put :update, :id => papers(:paper1).id, :paper => { :title => 'another title' }
assert_redirected_to paper_path(assigns(:paper))
end
- test "should destroy paper" do
+ def test_should_destroy_paper
assert_difference('Paper.count', -1) do
- delete :destroy, :id => papers(:one).id
+ delete :destroy, :id => papers(:paper1).id
end
assert_redirected_to papers_path
42 test/functional/payments_controller_test.rb
View
@@ -1,45 +1,19 @@
require File.dirname(__FILE__) + '/../test_helper'
class PaymentsControllerTest < ActionController::TestCase
- test "should get index" do
- get :index
- assert_response :success
- assert_not_nil assigns(:payments)
- end
-
- test "should get new" do
- get :new
- assert_response :success
- end
- test "should create payment" do
+ def test_should_create_payment
assert_difference('Payment.count') do
- post :create, :payment => { }
+ post(
+ :create,
+ :payment => {
+ :user_id => users(:user1).id,
+ :event_id => events(:event2).id
+ }
+ )
end
assert_redirected_to payment_path(assigns(:payment))
end
- test "should show payment" do
- get :show, :id => payments(:one).id
- assert_response :success
- end
-
- test "should get edit" do
- get :edit, :id => payments(:one).id
- assert_response :success
- end
-
- test "should update payment" do
- put :update, :id => payments(:one).id, :payment => { }
- assert_redirected_to payment_path(assigns(:payment))
- end
-
- test "should destroy payment" do
- assert_difference('Payment.count', -1) do
- delete :destroy, :id => payments(:one).id
- end
-
- assert_redirected_to payments_path
- end
end
40 test/functional/resources_controller_test.rb
View
@@ -1,43 +1,25 @@
require File.dirname(__FILE__) + '/../test_helper'
class ResourcesControllerTest < ActionController::TestCase
- test "should get index" do
- get :index
- assert_response :success
- assert_not_nil assigns(:resources)
- end
-
- test "should get new" do
- get :new
- assert_response :success
- end
- test "should create resource" do
+ def test_should_create_resource
assert_difference('Resource.count') do
- post :create, :resource => { }
+ post(
+ :create,
+ :resource => {
+ :user_id => users(:user1).id,
+ :paper_id => papers(:paper1).id,
+ :url => 'http://mi.url'
+ }
+ )
end
assert_redirected_to resource_path(assigns(:resource))
end
- test "should show resource" do
- get :show, :id => resources(:one).id
- assert_response :success
- end
-
- test "should get edit" do
- get :edit, :id => resources(:one).id
- assert_response :success
- end
-
- test "should update resource" do
- put :update, :id => resources(:one).id, :resource => { }
- assert_redirected_to resource_path(assigns(:resource))
- end
-
- test "should destroy resource" do
+ def test_should_destroy_resource
assert_difference('Resource.count', -1) do
- delete :destroy, :id => resources(:one).id
+ delete :destroy, :id => resources(:resource1).id
end
assert_redirected_to resources_path
45 test/functional/roles_controller_test.rb
View
@@ -1,45 +0,0 @@
-require File.dirname(__FILE__) + '/../test_helper'
-
-class RolesControllerTest < ActionController::TestCase
- test "should get index" do
- get :index
- assert_response :success
- assert_not_nil assigns(:roles)
- end
-
- test "should get new" do
- get :new
- assert_response :success
- end
-
- test "should create role" do
- assert_difference('Role.count') do
- post :create, :role => { }
- end
-
- assert_redirected_to role_path(assigns(:role))
- end
-
- test "should show role" do
- get :show, :id => roles(:one).id
- assert_response :success
- end
-
- test "should get edit" do
- get :edit, :id => roles(:one).id
- assert_response :success
- end
-
- test "should update role" do
- put :update, :id => roles(:one).id, :role => { }
- assert_redirected_to role_path(assigns(:role))
- end
-
- test "should destroy role" do
- assert_difference('Role.count', -1) do
- delete :destroy, :id => roles(:one).id
- end
-
- assert_redirected_to roles_path
- end
-end
24 test/functional/rooms_controller_test.rb
View
@@ -1,43 +1,43 @@
require File.dirname(__FILE__) + '/../test_helper'
class RoomsControllerTest < ActionController::TestCase
- test "should get index" do
+ def test_should_get_index
get :index
assert_response :success
assert_not_nil assigns(:rooms)
end
- test "should get new" do
+ def test_should_get_new
get :new
assert_response :success
end
- test "should create room" do
+ def test_should_create_room
assert_difference('Room.count') do
- post :create, :room => { }
+ post :create, :room => { :name => 'room' }
end
assert_redirected_to room_path(assigns(:room))
end
- test "should show room" do
- get :show, :id => rooms(:one).id
+ def test_should_show_room
+ get :show, :id => rooms(:room1).id
assert_response :success
end
- test "should get edit" do
- get :edit, :id => rooms(:one).id
+ def test_should_get_edit
+ get :edit, :id => rooms(:room1).id
assert_response :success
end
- test "should update room" do
- put :update, :id => rooms(:one).id, :room => { }
+ def test_should_update_room
+ put :update, :id => rooms(:room1).id, :room => { }
assert_redirected_to room_path(assigns(:room))
end
- test "should destroy room" do
+ def test_should_destroy_room
assert_difference('Room.count', -1) do
- delete :destroy, :id => rooms(:one).id
+ delete :destroy, :id => rooms(:room2).id
end
assert_redirected_to rooms_path
36 test/functional/speakers_controller_test.rb
View
@@ -1,43 +1,29 @@
require File.dirname(__FILE__) + '/../test_helper'
class SpeakersControllerTest < ActionController::TestCase
- test "should get index" do
+ def test_should_get_index
get :index
assert_response :success
assert_not_nil assigns(:speakers)
end
- test "should get new" do
- get :new
- assert_response :success
- end
-
- test "should create speaker" do
+ def test_should_create_speaker
assert_difference('Speaker.count') do
- post :create, :speaker => { }
+ post(
+ :create,
+ :speaker => {
+ :user_id => users(:user1).id,
+ :paper_id => papers(:paper2).id
+ }
+ )
end
assert_redirected_to speaker_path(assigns(:speaker))
end
- test "should show speaker" do
- get :show, :id => speakers(:one).id
- assert_response :success
- end
-
- test "should get edit" do
- get :edit, :id => speakers(:one).id
- assert_response :success
- end
-
- test "should update speaker" do
- put :update, :id => speakers(:one).id, :speaker => { }
- assert_redirected_to speaker_path(assigns(:speaker))
- end
-
- test "should destroy speaker" do
+ def test_should_destroy_speaker
assert_difference('Speaker.count', -1) do
- delete :destroy, :id => speakers(:one).id
+ delete :destroy, :id => speakers(:speaker_user1_paper1).id
end
assert_redirected_to speakers_path
34 test/functional/users_controller_test.rb
View
@@ -1,43 +1,53 @@
require File.dirname(__FILE__) + '/../test_helper'
class UsersControllerTest < ActionController::TestCase
- test "should get index" do
+ def test_should_get_index
get :index
assert_response :success
assert_not_nil assigns(:users)
end
- test "should get new" do
+ def test_should_get_new
get :new
assert_response :success
end
- test "should create user" do
+ def test_should_create_user
assert_difference('User.count') do
- post :create, :user => { }
+ post(
+ :create,
+ :user => {
+ :name => 'name',
+ :login => 'other_login',
+ :email => 'email@email.com',
+ :password => 'pass000',
+ :password_confirmation => 'pass000',
+ :role => User::ROLE_USER
+ }
+ )
end
assert_redirected_to user_path(assigns(:user))
end
- test "should show user" do
- get :show, :id => users(:one).id
+ def test_should_show_user
+ get :show, :id => users(:user1).id
assert_response :success
end
- test "should get edit" do
- get :edit, :id => users(:one).id
+ def test_should_get_edit
+ get :edit, :id => users(:user1).id
assert_response :success
end
- test "should update user" do
- put :update, :id => users(:one).id, :user => { }
+ def test_should_update_user
+ put :update, :id => users(:user1).id, :user => { :name => 'other name' }
assert_redirected_to user_path(assigns(:user))
end
- test "should destroy user" do
+ def test_should_destroy_user
assert_difference('User.count', -1) do
- delete :destroy, :id => users(:one).id
+ delete :destroy, :id => users(:user1).id
end
assert_redirected_to users_path
43 test/functional/votes_controller_test.rb
View
@@ -1,45 +1,24 @@
require File.dirname(__FILE__) + '/../test_helper'
class VotesControllerTest < ActionController::TestCase
- test "should get index" do
- get :index
- assert_response :success
- assert_not_nil assigns(:votes)
- end
-
- test "should get new" do
- get :new
- assert_response :success
- end
-
- test "should create vote" do
+ def test_should_create_vote
assert_difference('Vote.count') do
- post :create, :vote => { }
+ post(
+ :create,
+ :vote => {
+ :user_id => users(:user1).id,
+ :paper_id => papers(:paper2).id,
+ :points => 2
+ }
+ )
end
assert_redirected_to vote_path(assigns(:vote))
end
- test "should show vote" do
- get :show, :id => votes(:one).id
- assert_response :success
- end
-
- test "should get edit" do
- get :edit, :id => votes(:one).id
- assert_response :success
- end
-
- test "should update vote" do
- put :update, :id => votes(:one).id, :vote => { }
+ def test_should_update_vote
+ put :update, :id => votes(:vote1).id, :vote => { :points => 1 }
assert_redirected_to vote_path(assigns(:vote))
end
- test "should destroy vote" do
- assert_difference('Vote.count', -1) do
- delete :destroy, :id => votes(:one).id
- end
-
- assert_redirected_to votes_path
- end
end
6 test/unit/resource_test.rb
View
@@ -14,7 +14,11 @@ def test_relations
def test_create
assert_difference "Resource.count", 1 do
- Resource.create(:user => @user, :paper => @paper, :url => 'http://mi.url')
+ Resource.create(
+ :user => @user,
+ :paper => @paper,
+ :url => 'http://mi.url'
+ )
end
end
6 test/unit/vote_test.rb
View
@@ -15,7 +15,11 @@ def test_relations
def test_create
assert_difference "Vote.count", 1 do
- Vote.create(:user => @user, :paper => papers(:paper2), :points => 2)
+ Vote.create(
+ :user => @user,
+ :paper => papers(:paper2),
+ :points => 2
+ )
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.