Sha256: b5cbc0f73b124b166c702fce24b21c64f3840774fc65911123efda7bf97213c5

Contents?: true

Size: 1.69 KB

Versions: 50

Compression:

Stored size: 1.69 KB

Contents

require 'rails_helper'

RSpec.describe '/de/backend/authentifizierung/users', type: :feature do
  let(:resource_class) { Cmor::UserArea::User }
  let(:resource) { create(:cmor_user_area_user) }
  let(:resources) { create_list(:cmor_user_area_user, 3) }

  # List
  it { resources; expect(subject).to implement_index_action(self) }

  # Create
  it { 
    expect(subject).to implement_create_action(self)
      .for(resource_class)
      .within_form('#new_user') {
        # fill the needed form inputs via capybara here
        #
        # Example:
        #
        #     select 'de', from: 'slider[locale]'
        #     fill_in 'slider[name]', with: 'My first slider'
        #     check 'slider[auto_start]'
        #     fill_in 'slider[interval]', with: '3'
        fill_in 'user[email]', with: 'jane.doe@local.domain'
        fill_in 'user[password]', with: 'password'
        fill_in 'user[password_confirmation]', with: 'password'
      }
      .increasing{ Cmor::UserArea::User.count }.by(1)
  }
  
  # Read
  it { expect(subject).to implement_show_action(self).for(resource) }

  # Update
  it {
    expect(subject).to implement_update_action(self)
      .for(resource)
      .within_form('.edit_user') {
        # fill the needed form inputs via capybara here
        # 
        # Example:
        # 
        #     fill_in 'slider[name]', with: 'New name'
        fill_in 'user[email]', with: 'john.doe@local.domain'
      }
      .updating
      .from(resource.attributes)
      .to({ 'email' => 'john.doe@local.domain' }) # Example: .to({ 'name' => 'New name' })
  }

  # Delete
  it {
    expect(subject).to implement_delete_action(self)
      .for(resource)
      .reducing{ resource_class.count }.by(1)
  }
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
cmor_user_area_backend-0.0.53.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.52.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.51.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.50.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.49.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.48.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.45.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.44.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.43.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.42.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.41.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.40.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.39.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.38.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.37.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.36.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.35.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.34.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.33.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb
cmor_user_area_backend-0.0.32.pre spec/features/de/backend/authentifizierung/users_feature_spec.rb