Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
name: Spec live
if: github.repository == 'zendesk/zendesk_api_client_rb'
env:
SPEC_LIVE_USERNAME: ${{ secrets.SPEC_LIVE_USERNAME }}
SPEC_LIVE_PASSWORD: ${{ secrets.SPEC_LIVE_PASSWORD }}
SPEC_LIVE_ZENDESK_HOST: ${{ secrets.SPEC_LIVE_ZENDESK_HOST }}
SPEC_LIVE_USERNAME: ${{ secrets.SPEC_LIVE_USERNAME_NEW }}
SPEC_LIVE_PASSWORD: ${{ secrets.SPEC_LIVE_PASSWORD_NEW }}
SPEC_LIVE_ZENDESK_HOST: ${{ secrets.SPEC_LIVE_ZENDESK_HOST_NEW }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll replace current SPEC_LIVE_USERNAME etc. values and use them again after this PR is approved (and before merging it).

runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Test](https://github.com/zendesk/zendesk_api_client_rb/workflows/Test/badge.svg)](https://github.com/zendesk/zendesk_api_client_rb/actions/workflows/main.yml?query=branch%3Amaster)
[![Gem Version](https://badge.fury.io/rb/zendesk_api.svg)](https://badge.fury.io/rb/zendesk_api)
[![Code Climate](https://codeclimate.com/github/zendesk/zendesk_api_client_rb.svg)](https://codeclimate.com/github/zendesk/zendesk_api_client_rb)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn‘t work anymore and I don’t think we need to revive it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼 they don’t do open source scans anymore.


## Documentation

Expand Down Expand Up @@ -42,7 +41,7 @@ Add it to your Gemfile
gem "zendesk_api"
```

Then `bundle` as usual.
Then `bundle install` as usual.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bundle will stop working in Bundler 4.


## Configuration

Expand Down
8 changes: 1 addition & 7 deletions spec/core/middleware/response/parse_iso_dates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ def fake_response(data)
response
end

let(:parsed){
if RUBY_VERSION > "1.9"
"2012-02-01 13:14:15 UTC"
else
"Wed Feb 01 13:14:15 UTC 2012"
end
}
let(:parsed) { "2012-02-01 13:14:15 UTC" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the live specs change, I just noticed this very old and very unnecessary Ruby version check.


it "should parse dates" do
expect(fake_response('{"x":"2012-02-01T13:14:15Z"}').body["x"].to_s).to eq(parsed)
Expand Down
18 changes: 12 additions & 6 deletions spec/live/Readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
- Make an empty account (company name Z3N, email <something>@zendesk.com, so it can be filtered)
- Create an Admin user (ownwer cannot verify user identities) and ensure this new user has an organization. Then, add the new user credentials to `spec/fixtures/credentials.yml`
- Mark 1 ticket as solved, change end-users email to on your can receive, copy ticket url, login as end-user (do not just assume identity), rate it
If you are a Zendesk engineer, you can find the currently used test account in Pandora by “zendesk_api_client” tag (or pool).

In case you want to create a test account from scratch:
- Create an empty account (again, use Pandora if you are a Zendesk engineer). Set company name to Z3N.
- Create a second Admin user (don’t use the owner account in tests: owners cannot verify user identities). Ensure this new user has an organization. Then, add the new user credentials to `spec/fixtures/credentials.yml`
- Activate Help Center
- Enable “Allow customers to rate tickets” in People → Configuration → End users → Satisfaction
- Mark 1 ticket as solved, change end-users email to one you can receive, copy ticket url, login as end-user (do not just assume identity), rate it. You might need to check that request page layout includes Satisfaction (in Theming Center). Alternatively, receive an email from the “Request customer satisfaction rating” automation (change its parameters to send notifications earlier than in 24 hours)
- Create a user field in Admin Center → People → Configuration → User fields
- In `article_spec.rb`, replace `permission_group_id`. Use `curl` to list permission groups for this account: `curl https://{subdomain}.zendesk.com/api/v2/guide/permission_groups.json -u {email_address}:{password}`.
- After running `article_spec.rb` once, log in as an end user (it can be the same as above) and upvote the “What are these sections and articles doing here?” article.
- Add photo to user profile of that end user.
- Create a new ticket and cc "zendesk-api-client-ruby-end-user-#{client.config.username}" (run tests once to create this user)
- Suspend "zendesk-api-client-ruby-anonymous-#{client.config.username}" account, so tickets created by this account go to suspended
- Ensure you allow admins to set up user password (or `POST /api/v2/users/{user_id}/password.json` will fail). You can check this in the admin centre > security > advanced
- Go to Account > Localization and ensure you add `Spanish` to the list of additional languages. The `variant_spec` needs to create some items using spanish locale.
- Ensure the authenticated agent is the assigned to the main fixture ticket at `spec/fixtures/zendesk.rb`, or the `activities_spec` won't get any update, and thus, will fail.
2 changes: 1 addition & 1 deletion spec/live/article_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

describe "creating articles within a section" do
def valid_attributes
{ :name => "My Article", user_segment_id: nil, permission_group_id: 2801272, title: "My super article" }
{ :name => "My Article", user_segment_id: nil, permission_group_id: "9903096093850", title: "My super article" }
end

let(:section_article) do
Expand Down
4 changes: 2 additions & 2 deletions spec/live/ticket_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def valid_attributes
it_should_be_deletable
it_should_be_readable :tickets
it_should_be_readable user, :requested_tickets
it_should_be_readable current_user, :assigned_tickets, create: true
it_should_be_readable agent, :ccd_tickets, create: true
it_should_be_readable current_user, :assigned_tickets
it_should_be_readable agent, :ccd_tickets
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven’t full figured out why creation fails now, but we never created these users from here anyway (we create these users and assign and CC tickets during manual setup).

it_should_be_readable organization, :tickets

describe "#create" do
Expand Down
2 changes: 1 addition & 1 deletion spec/live/trigger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe ZendeskAPI::Trigger, :delete_after do
def valid_attributes
{
:category_id => "3",
:category_id => "9903501961242",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the category id from the new test account?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I don’t know why it worked with an account-specific like "3" before.

:title => "my test trigger",
:conditions => {
:all => [{ :field => "status", :operator => "is", :value => "open" }]
Expand Down