Sha256: 4be274f75b31efbd3eca19e29584735911ff3b24ad1ac37ded577009cbd40961
Contents?: true
Size: 1.78 KB
Versions: 3
Compression:
Stored size: 1.78 KB
Contents
require File.dirname(__FILE__) + '/../test_helper' class Muck::InvitesControllerTest < ActionController::TestCase tests Muck::InvitesController context "invites controller" do context "not logged in" do context "GET new" do setup do get :new end should_redirect_to("the login page") { login_path } end end context "logged in" do setup do @user = Factory(:user) activate_authlogic login_as @user end context "GET new" do setup do get :new end should_not_set_the_flash should_respond_with :success should_render_template :new end context "POST get_contacts (json)" do setup do post :get_contacts, :get_contacts => {:email => 'muck.invites@yahoo.com', :password => '3trickypass'}, :format => 'json' end should_not_set_the_flash should_respond_with :success should "return valid get_contacts json" do json = ActiveSupport::JSON.decode(@response.body).symbolize_keys! assert json[:success] assert json[:html].include?('support@folksemantic.com') end end context "POST get_contacts (html)" do setup do post :get_contacts, :get_contacts => {:email => 'muck.invites@yahoo.com', :password => '3trickypass'}, :format => 'html' end should_not_set_the_flash should_respond_with :success should_render_template :get_contacts end context "create invite" do should " be able to create a invite" do assert_difference "Invite.count" do post :create, :emails => [[Factory.next(:name),Factory.next(:email)]] end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems