-
Notifications
You must be signed in to change notification settings - Fork 185
use new account in live specs #601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
|
|
||
| [](https://github.com/zendesk/zendesk_api_client_rb/actions/workflows/main.yml?query=branch%3Amaster) | ||
| [](https://badge.fury.io/rb/zendesk_api) | ||
| [](https://codeclimate.com/github/zendesk/zendesk_api_client_rb) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏼 they don’t do open source scans anymore. |
||
|
|
||
| ## Documentation | ||
|
|
||
|
|
@@ -42,7 +41,7 @@ Add it to your Gemfile | |
| gem "zendesk_api" | ||
| ``` | ||
|
|
||
| Then `bundle` as usual. | ||
| Then `bundle install` as usual. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| ## Configuration | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
|
||
| 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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| describe ZendeskAPI::Trigger, :delete_after do | ||
| def valid_attributes | ||
| { | ||
| :category_id => "3", | ||
| :category_id => "9903501961242", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the category id from the new test account? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" }] | ||
|
|
||
There was a problem hiding this comment.
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_USERNAMEetc. values and use them again after this PR is approved (and before merging it).