2
2
3
3
module RubyCAS ::Server ::Core
4
4
describe RubyCAS ::Server ::Core ::Tickets do
5
+ let ( :client_hostname ) { 'myhost.test' }
6
+
5
7
before do
6
8
RubyCAS ::Server ::Core . setup ( "spec/config/config.yml" )
7
9
klass = Class . new {
@@ -11,31 +13,27 @@ module RubyCAS::Server::Core
11
13
@client_hostname = "myhost.test"
12
14
end
13
15
14
- Tickets = RubyCAS ::Server ::Core ::Tickets
15
-
16
- describe "login ticket object" do
17
- before do
18
- @lt = @cas . generate_login_ticket ( @client_hostname )
19
- end
16
+ describe '.generate_login_ticket(client_hostname)' , focus : true do
17
+ let ( :lt ) { Tickets . generate_login_ticket ( client_hostname ) }
20
18
21
19
it "should return a login ticket" do
22
- @ lt. class . should == Tickets ::LoginTicket
20
+ lt . class . should == Tickets ::LoginTicket
23
21
end
24
22
25
23
it "should set the client_hostname" do
26
- @ lt. client_hostname . should == @ client_hostname
24
+ lt . client_hostname . should == client_hostname
27
25
end
28
26
29
27
it "should set the ticket string" do
30
- @ lt. ticket . should_not be_nil
28
+ lt . ticket . should_not be_nil
31
29
end
32
30
33
31
it "should set the ticket string starting with 'LT'" do
34
- @ lt. ticket . should match /^LT/
32
+ lt . ticket . should match /^LT/
35
33
end
36
34
37
35
it "should not mark the ticket as consumed" do
38
- @ lt. consumed . should be_nil
36
+ lt . consumed . should be_nil
39
37
end
40
38
end
41
39
0 commit comments