Sha256: 98214cee798a80630c197dbe73735c0ec4de244190103fddf96cf8d665bc07a0

Contents?: true

Size: 954 Bytes

Versions: 3

Compression:

Stored size: 954 Bytes

Contents

require 'spec_helper'

feature "User signup" do

  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_with_session 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_with_session 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_with_session 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

3 entries across 3 versions & 1 rubygems

Version Path
cadenero-0.0.2.b10 spec/features/users/sign_up_spec.rb
cadenero-0.0.2.b8 spec/features/users/sign_up_spec.rb
cadenero-0.0.2.b7 spec/features/users/sign_up_spec.rb