Sha256: c3d197793739ac3a3968f4d627a36559ea666f6da191e628a02ffb8057e519b8

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'
require 'cadenero/testing_support/authentication_helpers'

feature "User signup" do
  include Cadenero::TestingSupport::AuthenticationHelpers

  let!(:account) { FactoryGirl.create(:account_with_schema) }
  let(:root_url) { "http://#{account.subdomain}.example.com/" }
  scenario "under an account" do
    user_email = successful_sign_up_user_in_existing_account account
    expect(user_email).to eq("user@example.com")
  end

  scenario "under two accounts" do
    account_user_email = successful_sign_up_user_in_existing_account account
    owner = Cadenero::User.where(email: account_user_email).first
    second_account = FactoryGirl.create(:account_with_schema, owner: owner)
    second_account_user_email = successful_sign_up_user_in_existing_account second_account
    get "#{root_url}v1/users/#{owner.id}"
    expect_subject_ids_to_have("user", "membership_ids", [second_account.id, account.id], 200)
    get "#{root_url}v1/users"
    expect(json_last_response_body["users"].length).to eq 2
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cadenero-0.0.2.b6 spec/features/users/sign_up_spec.rb
cadenero-0.0.2.b5 spec/features/users/sign_up_spec.rb