Skip to content

Commit b60047b

Browse files
authored
Merge pull request #601 from zendesk/jury.razumau/live_specs_3
use new account in live specs
2 parents 66a1e2c + 067671d commit b60047b

File tree

7 files changed

+21
-22
lines changed

7 files changed

+21
-22
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
name: Spec live
3939
if: github.repository == 'zendesk/zendesk_api_client_rb'
4040
env:
41-
SPEC_LIVE_USERNAME: ${{ secrets.SPEC_LIVE_USERNAME }}
42-
SPEC_LIVE_PASSWORD: ${{ secrets.SPEC_LIVE_PASSWORD }}
43-
SPEC_LIVE_ZENDESK_HOST: ${{ secrets.SPEC_LIVE_ZENDESK_HOST }}
41+
SPEC_LIVE_USERNAME: ${{ secrets.SPEC_LIVE_USERNAME_NEW }}
42+
SPEC_LIVE_PASSWORD: ${{ secrets.SPEC_LIVE_PASSWORD_NEW }}
43+
SPEC_LIVE_ZENDESK_HOST: ${{ secrets.SPEC_LIVE_ZENDESK_HOST_NEW }}
4444
runs-on: ubuntu-latest
4545
steps:
4646
- name: Checkout code

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![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)
44
[![Gem Version](https://badge.fury.io/rb/zendesk_api.svg)](https://badge.fury.io/rb/zendesk_api)
5-
[![Code Climate](https://codeclimate.com/github/zendesk/zendesk_api_client_rb.svg)](https://codeclimate.com/github/zendesk/zendesk_api_client_rb)
65

76
## Documentation
87

@@ -42,7 +41,7 @@ Add it to your Gemfile
4241
gem "zendesk_api"
4342
```
4443

45-
Then `bundle` as usual.
44+
Then `bundle install` as usual.
4645

4746
## Configuration
4847

spec/core/middleware/response/parse_iso_dates_spec.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ def fake_response(data)
88
response
99
end
1010

11-
let(:parsed){
12-
if RUBY_VERSION > "1.9"
13-
"2012-02-01 13:14:15 UTC"
14-
else
15-
"Wed Feb 01 13:14:15 UTC 2012"
16-
end
17-
}
11+
let(:parsed) { "2012-02-01 13:14:15 UTC" }
1812

1913
it "should parse dates" do
2014
expect(fake_response('{"x":"2012-02-01T13:14:15Z"}').body["x"].to_s).to eq(parsed)

spec/live/Readme.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
- Make an empty account (company name Z3N, email <something>@zendesk.com, so it can be filtered)
2-
- 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`
3-
- 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
1+
If you are a Zendesk engineer, you can find the currently used test account in Pandora by “zendesk_api_client” tag (or pool).
2+
3+
In case you want to create a test account from scratch:
4+
- Create an empty account (again, use Pandora if you are a Zendesk engineer). Set company name to Z3N.
5+
- 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`
6+
- Activate Help Center
7+
- Enable “Allow customers to rate tickets” in People → Configuration → End users → Satisfaction
8+
- 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)
9+
- Create a user field in Admin Center → People → Configuration → User fields
10+
- 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}`.
11+
- 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.
12+
- Add photo to user profile of that end user.
413
- Create a new ticket and cc "zendesk-api-client-ruby-end-user-#{client.config.username}" (run tests once to create this user)
5-
- Suspend "zendesk-api-client-ruby-anonymous-#{client.config.username}" account, so tickets created by this account go to suspended
614
- 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
7-
- 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.
8-
- 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.

spec/live/article_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

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

2727
let(:section_article) do

spec/live/ticket_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def valid_attributes
2323
it_should_be_deletable
2424
it_should_be_readable :tickets
2525
it_should_be_readable user, :requested_tickets
26-
it_should_be_readable current_user, :assigned_tickets, create: true
27-
it_should_be_readable agent, :ccd_tickets, create: true
26+
it_should_be_readable current_user, :assigned_tickets
27+
it_should_be_readable agent, :ccd_tickets
2828
it_should_be_readable organization, :tickets
2929

3030
describe "#create" do

spec/live/trigger_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
describe ZendeskAPI::Trigger, :delete_after do
44
def valid_attributes
55
{
6-
:category_id => "3",
6+
:category_id => "9903501961242",
77
:title => "my test trigger",
88
:conditions => {
99
:all => [{ :field => "status", :operator => "is", :value => "open" }]

0 commit comments

Comments
 (0)