Registration form more-or-less working, workshop scaffold is up

This commit is contained in:
Godwin
2014-03-13 21:20:17 -06:00
parent 4b79de7a24
commit 3d6ad3b432
22 changed files with 383 additions and 19 deletions
@@ -0,0 +1,49 @@
require 'test_helper'
class WorkshopsControllerTest < ActionController::TestCase
setup do
@workshop = workshops(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:workshops)
end
test "should get new" do
get :new
assert_response :success
end
test "should create workshop" do
assert_difference('Workshop.count') do
post :create, workshop: { conference_id: @workshop.conference_id, end_time: @workshop.end_time, info: @workshop.info, location_id: @workshop.location_id, min_facilitators: @workshop.min_facilitators, slug: @workshop.slug, start_time: @workshop.start_time, title: @workshop.title, workshop_presentation_style: @workshop.workshop_presentation_style, workshop_stream_id: @workshop.workshop_stream_id }
end
assert_redirected_to workshop_path(assigns(:workshop))
end
test "should show workshop" do
get :show, id: @workshop
assert_response :success
end
test "should get edit" do
get :edit, id: @workshop
assert_response :success
end
test "should update workshop" do
patch :update, id: @workshop, workshop: { conference_id: @workshop.conference_id, end_time: @workshop.end_time, info: @workshop.info, location_id: @workshop.location_id, min_facilitators: @workshop.min_facilitators, slug: @workshop.slug, start_time: @workshop.start_time, title: @workshop.title, workshop_presentation_style: @workshop.workshop_presentation_style, workshop_stream_id: @workshop.workshop_stream_id }
assert_redirected_to workshop_path(assigns(:workshop))
end
test "should destroy workshop" do
assert_difference('Workshop.count', -1) do
delete :destroy, id: @workshop
end
assert_redirected_to workshops_path
end
end
+16
View File
@@ -0,0 +1,16 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :workshop do
title "MyString"
slug "MyString"
info "MyText"
conference_id 1
workshop_stream_id 1
workshop_presentation_style 1
min_facilitators 1
location_id 1
start_time "2014-03-13 20:56:47"
end_time "2014-03-13 20:56:47"
end
end
+4
View File
@@ -0,0 +1,4 @@
require 'test_helper'
class WorkshopsHelperTest < ActionView::TestCase
end
+7
View File
@@ -0,0 +1,7 @@
require 'test_helper'
class WorkshopTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end