Sha256: 782a2b628091dad9a406e0fb24e260a5a2165dd1a3198c81805db50591adf3dd

Contents?: true

Size: 751 Bytes

Versions: 2

Compression:

Stored size: 751 Bytes

Contents

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

feature 'Accounts' do
  include Cadenero::TestingSupport::AuthenticationHelpers

  let(:errors_already_taken_subdomain)  {{ errors: {subdomain:["has already been taken"]} }.to_json} 

  scenario "creating an account" do
    sign_up_account
    expect(last_response.status).to eq 201
    expect(json_last_response_body).to have_content "authentication_token"
    expect(json_last_response_body["account"]["authentication_token"]).not_to eq nil
  end

  scenario "cannot create an account with an already used subdomain" do
    Cadenero::V1::Account.create!(create_account_params_json)
    sign_up_account
    expected_json_errors(errors_already_taken_subdomain)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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